From c7dc56babdb9613166a5122296272b5fc43d777c Mon Sep 17 00:00:00 2001 From: piotrpekala7 <31202938+piotrpekala7@users.noreply.github.com> Date: Wed, 17 Jun 2020 17:30:11 +0200 Subject: [PATCH] Fix for drawing grid --- src/app/cartography/components/d3-map/d3-map.component.html | 2 +- src/app/cartography/components/d3-map/d3-map.component.ts | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/app/cartography/components/d3-map/d3-map.component.html b/src/app/cartography/components/d3-map/d3-map.component.html index 0ec2cd97..b409cd50 100644 --- a/src/app/cartography/components/d3-map/d3-map.component.html +++ b/src/app/cartography/components/d3-map/d3-map.component.html @@ -1,7 +1,7 @@ - + diff --git a/src/app/cartography/components/d3-map/d3-map.component.ts b/src/app/cartography/components/d3-map/d3-map.component.ts index 2aee524b..6f2a1746 100644 --- a/src/app/cartography/components/d3-map/d3-map.component.ts +++ b/src/app/cartography/components/d3-map/d3-map.component.ts @@ -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'])