ol 9.1.1-dev.1712859476138 → 9.1.1-dev.1713040364051
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ol.js +2 -2
- package/dist/ol.js.map +1 -1
- package/interaction/Snap.d.ts.map +1 -1
- package/interaction/Snap.js +1 -0
- package/package.json +1 -1
- package/renderer/canvas/ImageLayer.d.ts.map +1 -1
- package/renderer/canvas/ImageLayer.js +4 -36
- package/renderer/canvas/Layer.d.ts +6 -0
- package/renderer/canvas/Layer.d.ts.map +1 -1
- package/renderer/canvas/Layer.js +46 -0
- package/renderer/canvas/TileLayer.d.ts.map +1 -1
- package/renderer/canvas/TileLayer.js +5 -36
- package/renderer/canvas/VectorLayer.d.ts.map +1 -1
- package/renderer/canvas/VectorLayer.js +2 -40
- package/util.js +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Snap.d.ts","sourceRoot":"","sources":["Snap.js"],"names":[],"mappings":";;;;;YA4Bc,OAAO,kBAAkB,EAAE,UAAU,GAAC,IAAI;;;;iBAC1C,OAAO,aAAa,EAAE,KAAK,GAAC,IAAI;;;;aAChC,OAAO,eAAe,EAAE,OAAO,GAAC,IAAI;;;;aACpC,MAAM,OAAO,kBAAkB,EAAE,UAAU,CAAC,GAAC,IAAI;;;;;;aAKjD,OAAO,eAAe,EAAE,OAAO;;;;aAC/B,MAAM,OAAO,kBAAkB,EAAE,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;sCAwC7C,OAAO,eAAe,EAAE,WAAW,CAAC,OAAO,eAAe,EAAE,UAAU,EAAE,OAAO,oBAAoB,EAAE,OAAO,EAAE,MAAM,CAAC,GACjI,OAAW,eAAe,EAAE,WAAW,CAAC,OAAO,oBAAoB,EAAE,KAAK,GAC1E,eAAqB,EAAE,OAAO,WAAW,EAAE,WAAW,EAAE,MAAM,CAAC,GAC/D,OAAW,eAAe,EAAE,WAAW,CAAC,MAAM,EAA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IAE/B;;;OAGG;IACH,mCAAoC;IAEpC;;;;;OAKG;IACH,gCAAiC;IAEjC;;;;;;OAMG;IACH,yBAA0B;IAE1B;;;OAGG;IACH,wBACoE;IAEpE;;;;OAIG;IACH,eAAyB;IAEzB;;;;OAIG;IACH,6BAUC;IAGH;;;;;;OAMG;IACH,oBALW,OAAO,eAAe,EAAE,OAAO,wCAyCzC;IAED;;;OAGG;IACH,qBASC;IAwBD;;;OAGG;IACH,0BAKC;IAED;;;OAGG;IACH,6BAKC;IAED;;;OAGG;IACH,6BAUC;IAgBD;;;;;;OAMG;IACH,uBALW,OAAO,eAAe,EAAE,OAAO,wCA0BzC;IAED;;;;;OAKG;IACH,YAFW,OAAO,WAAW,EAAE,OAAO,QAoDrC;IAED;;;;;OAKG;IACH,cALW,OAAO,aAAa,EAAE,KAAK,mBAC3B,OAAO,kBAAkB,EAAE,UAAU,OACrC,OAAO,WAAW,EAAE,OAAO,GAC1B,MAAM,GAAC,IAAI,CAgHtB;IAED;;;OAGG;IACH,uBAGC;IAED;;;;OAIG;IACH,+BAiBC;IAED;;;;OAIG;IACH,2CAQC;IAED;;;;OAIG;IACH,mCAKC;IAED;;;;OAIG;IACH,wCAQC;IAED;;;;OAIG;IACH,mCAIC;IAED;;;;OAIG;IACH,qCAWC;IAED;;;;OAIG;IACH,8BAEC;IAED;;;;OAIG;IACH,gCAQC;CACF;0BAhrBsC,wBAAwB;+BAJhC,cAAc"}
|
package/interaction/Snap.js
CHANGED
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageLayer.d.ts","sourceRoot":"","sources":["ImageLayer.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"ImageLayer.d.ts","sourceRoot":"","sources":["ImageLayer.js"],"names":[],"mappings":";AAqBA;;;;GAIG;AACH;IACE;;OAEG;IACH,qEAQC;IALC;;;OAGG;IACH,kBAFW,OAAO,gBAAgB,EAAE,OAAO,QAEzB;IAGpB;;OAEG;IACH,YAFY,OAAO,mBAAmB,EAAE,SAAS,CAIhD;IAqDD;;;OAGG;IACH,eAHW,OAAO,gBAAgB,EAAE,KAAK,GAC7B,iBAAiB,CAyC5B;IAED;;;;;OAKG;IACH,wBAJW,OAAO,cAAc,EAAE,UAAU,UACjC,WAAW,GACV,WAAW,CAuFtB;CACF;gCAxO+B,YAAY"}
|
|
@@ -7,8 +7,6 @@ import ViewHint from '../../ViewHint.js';
|
|
|
7
7
|
import {
|
|
8
8
|
apply as applyTransform,
|
|
9
9
|
compose as composeTransform,
|
|
10
|
-
makeInverse,
|
|
11
|
-
toString as toTransformString,
|
|
12
10
|
} from '../../transform.js';
|
|
13
11
|
import {
|
|
14
12
|
containsCoordinate,
|
|
@@ -167,39 +165,13 @@ class CanvasImageLayerRenderer extends CanvasLayerRenderer {
|
|
|
167
165
|
const scaleY =
|
|
168
166
|
(pixelRatio * imageResolutionY) / (viewResolution * imagePixelRatio);
|
|
169
167
|
|
|
170
|
-
|
|
171
|
-
const resolution = viewState.resolution;
|
|
172
|
-
const rotation = viewState.rotation;
|
|
173
|
-
// desired dimensions of the canvas in pixels
|
|
174
|
-
const width = Math.round((getWidth(extent) / resolution) * pixelRatio);
|
|
175
|
-
const height = Math.round((getHeight(extent) / resolution) * pixelRatio);
|
|
176
|
-
|
|
177
|
-
// set forward and inverse pixel transforms
|
|
178
|
-
composeTransform(
|
|
179
|
-
this.pixelTransform,
|
|
180
|
-
frameState.size[0] / 2,
|
|
181
|
-
frameState.size[1] / 2,
|
|
182
|
-
1 / pixelRatio,
|
|
183
|
-
1 / pixelRatio,
|
|
184
|
-
rotation,
|
|
185
|
-
-width / 2,
|
|
186
|
-
-height / 2,
|
|
187
|
-
);
|
|
188
|
-
makeInverse(this.inversePixelTransform, this.pixelTransform);
|
|
168
|
+
this.prepareContainer(frameState, target);
|
|
189
169
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
170
|
+
// desired dimensions of the canvas in pixels
|
|
171
|
+
const width = this.context.canvas.width;
|
|
172
|
+
const height = this.context.canvas.height;
|
|
193
173
|
|
|
194
174
|
const context = this.getRenderContext(frameState);
|
|
195
|
-
const canvas = this.context.canvas;
|
|
196
|
-
|
|
197
|
-
if (canvas.width != width || canvas.height != height) {
|
|
198
|
-
canvas.width = width;
|
|
199
|
-
canvas.height = height;
|
|
200
|
-
} else if (!this.containerReused) {
|
|
201
|
-
context.clearRect(0, 0, width, height);
|
|
202
|
-
}
|
|
203
175
|
|
|
204
176
|
// clipped rendering if layer extent is set
|
|
205
177
|
let clipped = false;
|
|
@@ -259,10 +231,6 @@ class CanvasImageLayerRenderer extends CanvasLayerRenderer {
|
|
|
259
231
|
}
|
|
260
232
|
context.imageSmoothingEnabled = true;
|
|
261
233
|
|
|
262
|
-
if (canvasTransform !== canvas.style.transform) {
|
|
263
|
-
canvas.style.transform = canvasTransform;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
234
|
return this.container;
|
|
267
235
|
}
|
|
268
236
|
}
|
|
@@ -89,6 +89,12 @@ declare class CanvasLayerRenderer<LayerType extends import("../../layer/Layer.js
|
|
|
89
89
|
* @protected
|
|
90
90
|
*/
|
|
91
91
|
protected clipUnrotated(context: CanvasRenderingContext2D, frameState: import("../../Map.js").FrameState, extent: import("../../extent.js").Extent): void;
|
|
92
|
+
/**
|
|
93
|
+
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
|
94
|
+
* @param {HTMLElement} target Target that may be used to render content to.
|
|
95
|
+
* @protected
|
|
96
|
+
*/
|
|
97
|
+
protected prepareContainer(frameState: import("../../Map.js").FrameState, target: HTMLElement): void;
|
|
92
98
|
/**
|
|
93
99
|
* @param {import("../../render/EventType.js").default} type Event type.
|
|
94
100
|
* @param {CanvasRenderingContext2D} context Context.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Layer.d.ts","sourceRoot":"","sources":["Layer.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Layer.d.ts","sourceRoot":"","sources":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,OAAO,cAAc,EAAE,UAAU,GAChC,OAAO,sCAAsC,EAAE,kBAAkB,CAS5E;IA2BD;;;;;;;;;;;OAWG;IACH,qCAVW,OAAO,qBAAqB,EAAE,UAAU,cACxC,MAAM,YACN,MAAM,cACN,MAAM,SACN,MAAM,UACN,MAAM,WACN,MAAM,GAEJ,OAAO,oBAAoB,EAAE,SAAS,CA2BlD;CASF;0BAvayB,aAAa"}
|
package/renderer/canvas/Layer.js
CHANGED
|
@@ -9,6 +9,8 @@ import {
|
|
|
9
9
|
apply as applyTransform,
|
|
10
10
|
compose as composeTransform,
|
|
11
11
|
create as createTransform,
|
|
12
|
+
makeInverse,
|
|
13
|
+
toString as toTransformString,
|
|
12
14
|
} from '../../transform.js';
|
|
13
15
|
import {asArray} from '../../color.js';
|
|
14
16
|
import {createCanvasContext2D} from '../../dom.js';
|
|
@@ -16,8 +18,10 @@ import {equals} from '../../array.js';
|
|
|
16
18
|
import {
|
|
17
19
|
getBottomLeft,
|
|
18
20
|
getBottomRight,
|
|
21
|
+
getHeight,
|
|
19
22
|
getTopLeft,
|
|
20
23
|
getTopRight,
|
|
24
|
+
getWidth,
|
|
21
25
|
} from '../../extent.js';
|
|
22
26
|
|
|
23
27
|
/**
|
|
@@ -245,6 +249,48 @@ class CanvasLayerRenderer extends LayerRenderer {
|
|
|
245
249
|
context.clip();
|
|
246
250
|
}
|
|
247
251
|
|
|
252
|
+
/**
|
|
253
|
+
* @param {import("../../Map.js").FrameState} frameState Frame state.
|
|
254
|
+
* @param {HTMLElement} target Target that may be used to render content to.
|
|
255
|
+
* @protected
|
|
256
|
+
*/
|
|
257
|
+
prepareContainer(frameState, target) {
|
|
258
|
+
const extent = frameState.extent;
|
|
259
|
+
const resolution = frameState.viewState.resolution;
|
|
260
|
+
const rotation = frameState.viewState.rotation;
|
|
261
|
+
const pixelRatio = frameState.pixelRatio;
|
|
262
|
+
const width = Math.round((getWidth(extent) / resolution) * pixelRatio);
|
|
263
|
+
const height = Math.round((getHeight(extent) / resolution) * pixelRatio);
|
|
264
|
+
// set forward and inverse pixel transforms
|
|
265
|
+
composeTransform(
|
|
266
|
+
this.pixelTransform,
|
|
267
|
+
frameState.size[0] / 2,
|
|
268
|
+
frameState.size[1] / 2,
|
|
269
|
+
1 / pixelRatio,
|
|
270
|
+
1 / pixelRatio,
|
|
271
|
+
rotation,
|
|
272
|
+
-width / 2,
|
|
273
|
+
-height / 2,
|
|
274
|
+
);
|
|
275
|
+
makeInverse(this.inversePixelTransform, this.pixelTransform);
|
|
276
|
+
|
|
277
|
+
const canvasTransform = toTransformString(this.pixelTransform);
|
|
278
|
+
this.useContainer(target, canvasTransform, this.getBackground(frameState));
|
|
279
|
+
|
|
280
|
+
if (!this.containerReused) {
|
|
281
|
+
const canvas = this.context.canvas;
|
|
282
|
+
if (canvas.width != width || canvas.height != height) {
|
|
283
|
+
canvas.width = width;
|
|
284
|
+
canvas.height = height;
|
|
285
|
+
} else {
|
|
286
|
+
this.getRenderContext(frameState).clearRect(0, 0, width, height);
|
|
287
|
+
}
|
|
288
|
+
if (canvasTransform !== canvas.style.transform) {
|
|
289
|
+
canvas.style.transform = canvasTransform;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
|
|
248
294
|
/**
|
|
249
295
|
* @param {import("../../render/EventType.js").default} type Event type.
|
|
250
296
|
* @param {CanvasRenderingContext2D} context Context.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TileLayer.d.ts","sourceRoot":"","sources":["TileLayer.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"TileLayer.d.ts","sourceRoot":"","sources":["TileLayer.js"],"names":[],"mappings":";AA0BA;;;;;;GAMG;AACH;IACE;;OAEG;IACH,uBAFW,SAAS,EA0DnB;IArDC;;;OAGG;IACH,eAFU,OAAO,CAEQ;IAEzB;;;OAGG;IACH,wBAA2B;IAE3B;;;OAGG;IACH,8BAFU,MAAM,CAEO;IAEvB;;;OAGG;IACH,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AAsB,EAAE,OAAO,YACtC,OAAO,4BAA4B,EAAE,OAAO,cAC5C,MAAM,cACN,OAAO,0BAA0B,EAAE,OAAO,UAC1C,OAAO,iBAAiB,EAAE,MAAM,YAChC,MAAM,WACN,MAAM,yBACG,OAAO,eAAe,EAAE,OAAO,KAAE,IAAI,qBAmExD;CACF;gCA/tB+B,YAAY"}
|
|
@@ -9,19 +9,15 @@ import TileState from '../../TileState.js';
|
|
|
9
9
|
import {
|
|
10
10
|
apply as applyTransform,
|
|
11
11
|
compose as composeTransform,
|
|
12
|
-
makeInverse,
|
|
13
|
-
toString as toTransformString,
|
|
14
12
|
} from '../../transform.js';
|
|
15
13
|
import {ascending} from '../../array.js';
|
|
16
14
|
import {
|
|
17
15
|
containsCoordinate,
|
|
18
16
|
createEmpty,
|
|
19
17
|
equals,
|
|
20
|
-
getHeight,
|
|
21
18
|
getIntersection,
|
|
22
19
|
getRotatedViewport,
|
|
23
20
|
getTopLeft,
|
|
24
|
-
getWidth,
|
|
25
21
|
intersects,
|
|
26
22
|
} from '../../extent.js';
|
|
27
23
|
import {fromUserExtent} from '../../proj.js';
|
|
@@ -265,9 +261,12 @@ class CanvasTileLayerRenderer extends CanvasLayerRenderer {
|
|
|
265
261
|
let extent = frameState.extent;
|
|
266
262
|
const resolution = frameState.viewState.resolution;
|
|
267
263
|
const tilePixelRatio = tileSource.getTilePixelRatio(pixelRatio);
|
|
264
|
+
|
|
265
|
+
this.prepareContainer(frameState, target);
|
|
266
|
+
|
|
268
267
|
// desired dimensions of the canvas in pixels
|
|
269
|
-
const width =
|
|
270
|
-
const height =
|
|
268
|
+
const width = this.context.canvas.width;
|
|
269
|
+
const height = this.context.canvas.height;
|
|
271
270
|
|
|
272
271
|
const layerExtent =
|
|
273
272
|
layerState.extent && fromUserExtent(layerState.extent, projection);
|
|
@@ -368,26 +367,7 @@ class CanvasTileLayerRenderer extends CanvasLayerRenderer {
|
|
|
368
367
|
const canvasScale =
|
|
369
368
|
((tileResolution / viewResolution) * pixelRatio) / tilePixelRatio;
|
|
370
369
|
|
|
371
|
-
// set forward and inverse pixel transforms
|
|
372
|
-
composeTransform(
|
|
373
|
-
this.pixelTransform,
|
|
374
|
-
frameState.size[0] / 2,
|
|
375
|
-
frameState.size[1] / 2,
|
|
376
|
-
1 / pixelRatio,
|
|
377
|
-
1 / pixelRatio,
|
|
378
|
-
rotation,
|
|
379
|
-
-width / 2,
|
|
380
|
-
-height / 2,
|
|
381
|
-
);
|
|
382
|
-
|
|
383
|
-
const canvasTransform = toTransformString(this.pixelTransform);
|
|
384
|
-
|
|
385
|
-
this.useContainer(target, canvasTransform, this.getBackground(frameState));
|
|
386
|
-
|
|
387
370
|
const context = this.getRenderContext(frameState);
|
|
388
|
-
const canvas = this.context.canvas;
|
|
389
|
-
|
|
390
|
-
makeInverse(this.inversePixelTransform, this.pixelTransform);
|
|
391
371
|
|
|
392
372
|
// set scale transform for calculating tile positions on the canvas
|
|
393
373
|
composeTransform(
|
|
@@ -401,13 +381,6 @@ class CanvasTileLayerRenderer extends CanvasLayerRenderer {
|
|
|
401
381
|
-height / 2,
|
|
402
382
|
);
|
|
403
383
|
|
|
404
|
-
if (canvas.width != width || canvas.height != height) {
|
|
405
|
-
canvas.width = width;
|
|
406
|
-
canvas.height = height;
|
|
407
|
-
} else if (!this.containerReused) {
|
|
408
|
-
context.clearRect(0, 0, width, height);
|
|
409
|
-
}
|
|
410
|
-
|
|
411
384
|
if (layerExtent) {
|
|
412
385
|
this.clipUnrotated(context, frameState, layerExtent);
|
|
413
386
|
}
|
|
@@ -566,10 +539,6 @@ class CanvasTileLayerRenderer extends CanvasLayerRenderer {
|
|
|
566
539
|
}
|
|
567
540
|
context.imageSmoothingEnabled = true;
|
|
568
541
|
|
|
569
|
-
if (canvasTransform !== canvas.style.transform) {
|
|
570
|
-
canvas.style.transform = canvasTransform;
|
|
571
|
-
}
|
|
572
|
-
|
|
573
542
|
return this.container;
|
|
574
543
|
}
|
|
575
544
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VectorLayer.d.ts","sourceRoot":"","sources":["VectorLayer.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"VectorLayer.d.ts","sourceRoot":"","sources":["VectorLayer.js"],"names":[],"mappings":";AA6CA;;;;GAIG;AACH;IACE;;OAEG;IACH,gFAwGC;IArGC,eAAe;IACf,qCAA2E;IAE3E;;OAEG;IACH,yBAFU,OAAO,CAEW;IAE5B;;OAEG;IACH,wBAFU,SAAS,GAAC,IAAI,CAEU;IAElC;;OAEG;IACH,mBAFU,MAAM,OAAO,kBAAkB,EAAE,OAAO,CAAC,CAEtB;IAE7B;;;OAGG;IACH,0BAA2B;IAE3B;;;OAGG;IACH,4BAA8B;IAE9B;;;OAGG;IACH,wBAAoC;IAEpC;;;OAGG;IACH,+BAA2C;IAE3C;;;OAGG;IACH,0BAAsB;IAEtB;;;OAGG;IACH,wBAA2B;IAE3B;;;OAGG;IACH,4BAA+B;IAE/B;;;OAGG;IACH,4BAA4B;IAE5B;;;OAGG;IACH,6BAAgC;IAEhC;;;OAGG;IACH,qBAAwB;IAExB;;;OAGG;IACH,oBAFU,OAAO,CAEa;IAE9B;;;OAGG;IACH,UAFU,OAAO,CAEG;IAEpB;;;OAGG;IACH,uBAA0B;IAE1B;;;OAGG;IACH,iBAAiB;IAGnB;;;;;OAKG;IACH,4BALW,aAAa,cACb,OAAO,cAAc,EAAE,UAAU,6CAyD3C;IAED;;OAEG;IACH,wBASC;IAED;;OAEG;IACH,0BAWC;IAED;;;OAGG;IACH,4BAFW,OAAO,cAAc,EAAE,UAAU,QAO3C;IAgFD;;;;;OAKG;IACH,mBAJW,OAAO,gBAAgB,EAAE,KAAK,GAC7B,QAAQ,MAAM,OAAO,eAAe,EAAE,OAAO,CAAC,CAAC,CA+F1D;IA4FD;;;;OAIG;IACH,gCAEC;IAwMD;;;;;;;;;OASG;IACH,uBATW,OAAO,kBAAkB,EAAE,OAAO,oBAClC,MAAM,UACN,OAAO,sBAAsB,EAAE,OAAO,GAAC,MAAM,OAAO,sBAAsB,EAAE,OAAO,CAAC,gBACpF,OAAO,qCAAqC,EAAE,OAAO,mIAIpD,OAAO,CA0ClB;CACF;gCAhxB6C,YAAY;0BAKnD,sCAAsC"}
|
|
@@ -15,12 +15,7 @@ import {
|
|
|
15
15
|
createHitDetectionImageData,
|
|
16
16
|
hitDetect,
|
|
17
17
|
} from '../../render/canvas/hitdetect.js';
|
|
18
|
-
import {
|
|
19
|
-
apply,
|
|
20
|
-
compose as composeTransform,
|
|
21
|
-
makeInverse,
|
|
22
|
-
toString as transformToString,
|
|
23
|
-
} from '../../transform.js';
|
|
18
|
+
import {apply} from '../../transform.js';
|
|
24
19
|
import {
|
|
25
20
|
buffer,
|
|
26
21
|
containsExtent,
|
|
@@ -284,34 +279,12 @@ class CanvasVectorLayerRenderer extends CanvasLayerRenderer {
|
|
|
284
279
|
* @return {HTMLElement|null} The rendered element.
|
|
285
280
|
*/
|
|
286
281
|
renderFrame(frameState, target) {
|
|
287
|
-
const pixelRatio = frameState.pixelRatio;
|
|
288
282
|
const layerState = frameState.layerStatesArray[frameState.layerIndex];
|
|
289
283
|
this.opacity_ = layerState.opacity;
|
|
290
|
-
const extent = frameState.extent;
|
|
291
284
|
const viewState = frameState.viewState;
|
|
292
|
-
const resolution = viewState.resolution;
|
|
293
|
-
const width = Math.round((getWidth(extent) / resolution) * pixelRatio);
|
|
294
|
-
const height = Math.round((getHeight(extent) / resolution) * pixelRatio);
|
|
295
|
-
|
|
296
|
-
// set forward and inverse pixel transforms
|
|
297
|
-
composeTransform(
|
|
298
|
-
this.pixelTransform,
|
|
299
|
-
frameState.size[0] / 2,
|
|
300
|
-
frameState.size[1] / 2,
|
|
301
|
-
1 / pixelRatio,
|
|
302
|
-
1 / pixelRatio,
|
|
303
|
-
viewState.rotation,
|
|
304
|
-
-width / 2,
|
|
305
|
-
-height / 2,
|
|
306
|
-
);
|
|
307
|
-
makeInverse(this.inversePixelTransform, this.pixelTransform);
|
|
308
|
-
|
|
309
|
-
const canvasTransform = transformToString(this.pixelTransform);
|
|
310
|
-
|
|
311
|
-
this.useContainer(target, canvasTransform, this.getBackground(frameState));
|
|
312
285
|
|
|
286
|
+
this.prepareContainer(frameState, target);
|
|
313
287
|
const context = this.context;
|
|
314
|
-
const canvas = context.canvas;
|
|
315
288
|
|
|
316
289
|
const replayGroup = this.replayGroup_;
|
|
317
290
|
let render = replayGroup && !replayGroup.isEmpty();
|
|
@@ -324,17 +297,6 @@ class CanvasVectorLayerRenderer extends CanvasLayerRenderer {
|
|
|
324
297
|
}
|
|
325
298
|
}
|
|
326
299
|
|
|
327
|
-
// resize and clear
|
|
328
|
-
if (canvas.width != width || canvas.height != height) {
|
|
329
|
-
canvas.width = width;
|
|
330
|
-
canvas.height = height;
|
|
331
|
-
if (canvas.style.transform !== canvasTransform) {
|
|
332
|
-
canvas.style.transform = canvasTransform;
|
|
333
|
-
}
|
|
334
|
-
} else if (!this.containerReused) {
|
|
335
|
-
context.clearRect(0, 0, width, height);
|
|
336
|
-
}
|
|
337
|
-
|
|
338
300
|
this.setDrawContext_();
|
|
339
301
|
|
|
340
302
|
this.preRender(context, frameState);
|
package/util.js
CHANGED