ol 7.1.1-dev.1669108190848 → 7.1.1-dev.1669317448483
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/package.json +1 -1
- package/render/canvas/Immediate.d.ts +5 -0
- package/render/canvas/Immediate.d.ts.map +1 -1
- package/render/canvas/Immediate.js +15 -0
- package/render.d.ts.map +1 -1
- package/render.js +3 -1
- package/util.js +1 -1
package/package.json
CHANGED
|
@@ -39,6 +39,11 @@ declare class CanvasImmediateRenderer extends VectorContext {
|
|
|
39
39
|
* @type {import("../../transform.js").Transform}
|
|
40
40
|
*/
|
|
41
41
|
private transform_;
|
|
42
|
+
/**
|
|
43
|
+
* @private
|
|
44
|
+
* @type {number}
|
|
45
|
+
*/
|
|
46
|
+
private transformRotation_;
|
|
42
47
|
/**
|
|
43
48
|
* @private
|
|
44
49
|
* @type {number}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Immediate.d.ts","sourceRoot":"","sources":["Immediate.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Immediate.d.ts","sourceRoot":"","sources":["Immediate.js"],"names":[],"mappings":";AAgCA;;;;;;;;GAQG;AACH;IACE;;;;;;;;OAQG;IACH,qBARW,wBAAwB,cACxB,MAAM,UACN,OAAO,iBAAiB,EAAE,MAAM,aAChC,OAAO,oBAAoB,EAAE,SAAS,gBACtC,MAAM,gHAkOhB;IAnNC;;;OAGG;IACH,iBAAuB;IAEvB;;;OAGG;IACH,oBAA6B;IAE7B;;;OAGG;IACH,gBAAqB;IAErB;;;OAGG;IACH,mBAA2B;IAE3B;;;OAGG;IACH,2BAEK;IAEL;;;OAGG;IACH,sBAAiC;IAEjC;;;OAGG;IACH,0BAAyC;IAEzC;;;OAGG;IACH,uBAAmC;IAEnC;;;OAGG;IACH,0BAA6B;IAE7B;;;OAGG;IACH,4BAA+B;IAE/B;;;OAGG;IACH,0BAA6B;IAE7B;;;OAGG;IACH,mBAAsB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O,QAmBpF;IAED;;;;;OAKG;IACH,yBAFW,OAAO,0BAA0B,EAAE,OAAO,GAAC,OAAO,eAAe,EAAE,OAAO,QAgCpF;IAED;;;;;OAKG;IACH,8BAFW,OAAO,+BAA+B,EAAE,OAAO,GAAC,OAAO,eAAe,EAAE,OAAO,QAuCzF;IAED;;;;;OAKG;IACH,sBAFW,OAAO,uBAAuB,EAAE,OAAO,GAAC,OAAO,eAAe,EAAE,OAAO,QAwCjF;IAED;;;;OAIG;IACH,2BAFW,OAAO,4BAA4B,EAAE,OAAO,QA0CtD;IAED;;;OAGG;IACH,6BAcC;IAED;;;OAGG;IACH,+BAmDC;IAED;;;OAGG;IACH,6BA6BC;IAiED;;;;;OAKG;IACH,0BAFW,OAAO,sBAAsB,EAAE,OAAO,QA0BhD;IAED;;;;;OAKG;IACH,wBAFW,OAAO,qBAAqB,EAAE,OAAO,QA6F/C;CACF"}
|
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
} from '../canvas.js';
|
|
27
27
|
import {equals} from '../../array.js';
|
|
28
28
|
import {intersects} from '../../extent.js';
|
|
29
|
+
import {toFixed} from '../../math.js';
|
|
29
30
|
import {transform2D} from '../../geom/flat/transform.js';
|
|
30
31
|
import {transformGeom2D} from '../../geom/SimpleGeometry.js';
|
|
31
32
|
|
|
@@ -83,6 +84,14 @@ class CanvasImmediateRenderer extends VectorContext {
|
|
|
83
84
|
*/
|
|
84
85
|
this.transform_ = transform;
|
|
85
86
|
|
|
87
|
+
/**
|
|
88
|
+
* @private
|
|
89
|
+
* @type {number}
|
|
90
|
+
*/
|
|
91
|
+
this.transformRotation_ = transform
|
|
92
|
+
? toFixed(Math.atan2(transform[1], transform[0]), 10)
|
|
93
|
+
: 0;
|
|
94
|
+
|
|
86
95
|
/**
|
|
87
96
|
* @private
|
|
88
97
|
* @type {number}
|
|
@@ -290,6 +299,9 @@ class CanvasImmediateRenderer extends VectorContext {
|
|
|
290
299
|
context.globalAlpha = alpha * this.imageOpacity_;
|
|
291
300
|
}
|
|
292
301
|
let rotation = this.imageRotation_;
|
|
302
|
+
if (this.transformRotation_ === 0) {
|
|
303
|
+
rotation -= this.viewRotation_;
|
|
304
|
+
}
|
|
293
305
|
if (this.imageRotateWithView_) {
|
|
294
306
|
rotation += this.viewRotation_;
|
|
295
307
|
}
|
|
@@ -375,6 +387,9 @@ class CanvasImmediateRenderer extends VectorContext {
|
|
|
375
387
|
);
|
|
376
388
|
const context = this.context_;
|
|
377
389
|
let rotation = this.textRotation_;
|
|
390
|
+
if (this.transformRotation_ === 0) {
|
|
391
|
+
rotation -= this.viewRotation_;
|
|
392
|
+
}
|
|
378
393
|
if (this.textRotateWithView_) {
|
|
379
394
|
rotation += this.viewRotation_;
|
|
380
395
|
}
|
package/render.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["render.js"],"names":[],"mappings":"AAcA;;;;;;;;;GASG;AAEH;;;;;;GAMG;AAEH;;;;;;;;GAQG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,mCALW,wBAAwB,2CAEvB,uBAAuB,CAiBlC;AAED;;;;;GAKG;AACH,wCAJW,OAAO,mBAAmB,EAAE,OAAO,GAClC,uBAAuB,
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["render.js"],"names":[],"mappings":"AAcA;;;;;;;;;GASG;AAEH;;;;;;GAMG;AAEH;;;;;;;;GAQG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,mCALW,wBAAwB,2CAEvB,uBAAuB,CAiBlC;AAED;;;;;GAKG;AACH,wCAJW,OAAO,mBAAmB,EAAE,OAAO,GAClC,uBAAuB,CAuClC;AAED;;;;;;;GAOG;AACH,sCANW,OAAO,mBAAmB,EAAE,OAAO,SACnC,OAAO,YAAY,EAAE,KAAK,GAEzB,OAAO,YAAY,EAAE,KAAK,CAKrC;;;;;aA5Ha,wBAAwB;;;;aACxB,OAAO,cAAc,EAAE,WAAW;;;;cAClC,OAAO,0BAA0B,EAAE,OAAO;;;;gBAC1C,MAAM;;;;;gBACN,MAAM;;;;cAEN,MAAM;;;;;;;mCAQE,OAAO,cAAc,EAAE,WAAW,QAAE,OAAO,cAAc,EAAE,WAAW,KAAE,MAAM"}
|
package/render.js
CHANGED
|
@@ -96,7 +96,9 @@ export function getVectorContext(event) {
|
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
// canvas may be at a different pixel ratio than frameState.pixelRatio
|
|
99
|
-
const
|
|
99
|
+
const a = event.inversePixelTransform[0];
|
|
100
|
+
const b = event.inversePixelTransform[1];
|
|
101
|
+
const canvasPixelRatio = Math.sqrt(a * a + b * b);
|
|
100
102
|
const frameState = event.frameState;
|
|
101
103
|
const transform = multiplyTransform(
|
|
102
104
|
event.inversePixelTransform.slice(),
|
package/util.js
CHANGED