Skip to content

Commit 1d1f8b9

Browse files
author
ChenGuanglin
committed
【bug】 fix 修改系统屏幕文本缩放比例,graphicLayer还是偏移的问题 commit by chengl reviewed by gaozy
1 parent a723f63 commit 1d1f8b9

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

dist/openlayers/iclient9-openlayers-es6.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107459,17 +107459,17 @@ class CanvasRenderer_GraphicCanvasRenderer extends external_ol_default.a.Object
107459107459

107460107460
_resize() {
107461107461
let size = this.map.getSize();
107462-
let width = size[0] * this.pixelRatio;
107463-
let height = size[1] * this.pixelRatio;
107462+
let width = size[0];
107463+
let height = size[1];
107464107464
let xRatio = width / this.width;
107465107465
let yRatio = height / this.height;
107466107466
this.width = width;
107467107467
this.height = height;
107468107468
this.mapWidth = this.mapWidth * xRatio;
107469107469
this.mapHeight = this.mapHeight * yRatio;
107470107470

107471-
this.canvas.width = this.mapWidth * this.pixelRatio;
107472-
this.canvas.height = this.mapHeight * this.pixelRatio;
107471+
this.canvas.width = this.mapWidth;
107472+
this.canvas.height = this.mapHeight;
107473107473
this.canvas.style.width = this.width + "px";
107474107474
this.canvas.style.height = this.height + "px";
107475107475
}

dist/openlayers/iclient9-openlayers.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106320,17 +106320,17 @@ var GraphicCanvasRenderer = exports.GraphicCanvasRenderer = function (_ol$Object
106320106320
key: "_resize",
106321106321
value: function _resize() {
106322106322
var size = this.map.getSize();
106323-
var width = size[0] * this.pixelRatio;
106324-
var height = size[1] * this.pixelRatio;
106323+
var width = size[0];
106324+
var height = size[1];
106325106325
var xRatio = width / this.width;
106326106326
var yRatio = height / this.height;
106327106327
this.width = width;
106328106328
this.height = height;
106329106329
this.mapWidth = this.mapWidth * xRatio;
106330106330
this.mapHeight = this.mapHeight * yRatio;
106331106331

106332-
this.canvas.width = this.mapWidth * this.pixelRatio;
106333-
this.canvas.height = this.mapHeight * this.pixelRatio;
106332+
this.canvas.width = this.mapWidth;
106333+
this.canvas.height = this.mapHeight;
106334106334
this.canvas.style.width = this.width + "px";
106335106335
this.canvas.style.height = this.height + "px";
106336106336
}

dist/openlayers/iclient9-openlayers.min.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/openlayers/overlay/graphic/CanvasRenderer.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,17 +76,17 @@ export class GraphicCanvasRenderer extends ol.Object {
7676

7777
_resize() {
7878
let size = this.map.getSize();
79-
let width = size[0] * this.pixelRatio;
80-
let height = size[1] * this.pixelRatio;
79+
let width = size[0];
80+
let height = size[1];
8181
let xRatio = width / this.width;
8282
let yRatio = height / this.height;
8383
this.width = width;
8484
this.height = height;
8585
this.mapWidth = this.mapWidth * xRatio;
8686
this.mapHeight = this.mapHeight * yRatio;
8787

88-
this.canvas.width = this.mapWidth * this.pixelRatio;
89-
this.canvas.height = this.mapHeight * this.pixelRatio;
88+
this.canvas.width = this.mapWidth;
89+
this.canvas.height = this.mapHeight;
9090
this.canvas.style.width = this.width + "px";
9191
this.canvas.style.height = this.height + "px";
9292
}

0 commit comments

Comments
 (0)