mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-02-21 02:01:19 +00:00
Fix for drawing grid
This commit is contained in:
parent
1a8701d845
commit
c7dc56babd
@ -1,7 +1,7 @@
|
||||
<svg id="map" #svg class="map" preserveAspectRatio="none" movingCanvas zoomingCanvas>
|
||||
<filter id="grayscale"><feColorMatrix id="feGrayscale" type="saturate" values="0" /></filter>
|
||||
<defs>
|
||||
<pattern id="gridDrawing" attr.width="{{project.drawing_grid_size}}" attr.height="{{project.drawing_grid_size}}" patternUnits="userSpaceOnUse">
|
||||
<pattern attr.x="{{drawingGridX}}" attr.y="{{drawingGridY}}" id="gridDrawing" attr.width="{{project.drawing_grid_size}}" attr.height="{{project.drawing_grid_size}}" patternUnits="userSpaceOnUse">
|
||||
<path attr.d="M {{project.drawing_grid_size}} 0 L 0 0 0 {{project.drawing_grid_size}}" fill="none" stroke="silver" attr.stroke-width="{{gridVisibility}}"/>
|
||||
</pattern>
|
||||
</defs>
|
||||
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.4 KiB |
@ -66,6 +66,8 @@ export class D3MapComponent implements OnInit, OnChanges, OnDestroy {
|
||||
|
||||
public nodeGridX: number = 0;
|
||||
public nodeGridY: number = 0;
|
||||
public drawingGridX: number = 0;
|
||||
public drawingGridY: number = 0;
|
||||
|
||||
constructor(
|
||||
private graphDataManager: GraphDataManager,
|
||||
@ -206,6 +208,9 @@ export class D3MapComponent implements OnInit, OnChanges, OnDestroy {
|
||||
updateGrid() {
|
||||
this.nodeGridX = (this.project.scene_width/2 - (Math.floor(this.project.scene_width/2 / this.project.grid_size) * this.project.grid_size));
|
||||
this.nodeGridY = (this.project.scene_height/2 - (Math.floor(this.project.scene_height/2 / this.project.grid_size) * this.project.grid_size));
|
||||
|
||||
this.drawingGridX = (this.project.scene_width/2 - (Math.floor(this.project.scene_width/2 / this.project.drawing_grid_size) * this.project.drawing_grid_size));
|
||||
this.drawingGridY = (this.project.scene_height/2 - (Math.floor(this.project.scene_height/2 / this.project.drawing_grid_size) * this.project.drawing_grid_size));
|
||||
}
|
||||
|
||||
@HostListener('window:resize', ['$event'])
|
||||
|
Loading…
x
Reference in New Issue
Block a user