|
@@ -9,10 +9,10 @@ export class DataService {
|
|
this.grid = {
|
|
this.grid = {
|
|
startX: 0,
|
|
startX: 0,
|
|
startY: 0,
|
|
startY: 0,
|
|
- step1: 50,
|
|
|
|
- step2: 250,
|
|
|
|
- defalutstep1: 50,
|
|
|
|
- defalutstep2: 250,
|
|
|
|
|
|
+ step1: 50 * coordinate.ratio,
|
|
|
|
+ step2: 250 * coordinate.ratio,
|
|
|
|
+ defalutstep1: 50 * coordinate.ratio,
|
|
|
|
+ defalutstep2: 250 * coordinate.ratio,
|
|
display: true,
|
|
display: true,
|
|
};
|
|
};
|
|
this.vectorData = {
|
|
this.vectorData = {
|
|
@@ -82,12 +82,12 @@ export class DataService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- setGridForZoom(w, h, ratio) {
|
|
|
|
- console.log("setGridForZoom:" + ratio);
|
|
|
|
- this.grid.startX = w / 2 - (ratio * w) / 2;
|
|
|
|
- this.grid.startY = w / 2 - (ratio * h) / 2;
|
|
|
|
- this.grid.step1 = this.grid.defalutstep1 * ratio;
|
|
|
|
- this.grid.step2 = this.grid.defalutstep2 * ratio;
|
|
|
|
|
|
+ setGridForZoom(w, h, zoom) {
|
|
|
|
+ console.log("setGridForZoom:" + zoom);
|
|
|
|
+ this.grid.startX = w / 2 - (zoom * w) / 2;
|
|
|
|
+ this.grid.startY = w / 2 - (zoom * h) / 2;
|
|
|
|
+ this.grid.step1 = this.grid.defalutstep1 * zoom;
|
|
|
|
+ this.grid.step2 = this.grid.defalutstep2 * zoom;
|
|
while (this.grid.startX > 0) {
|
|
while (this.grid.startX > 0) {
|
|
this.grid.startX -= this.grid.step2;
|
|
this.grid.startX -= this.grid.step2;
|
|
}
|
|
}
|