gis-common 5.1.34 → 5.1.35
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/gis-common.es.js +7 -5
- package/dist/gis-common.umd.js +1 -1
- package/dist/index.d.ts +5 -1
- package/package.json +1 -1
package/dist/gis-common.es.js
CHANGED
|
@@ -3424,12 +3424,14 @@ class CanvasDrawer {
|
|
|
3424
3424
|
this.ctx.stroke();
|
|
3425
3425
|
}
|
|
3426
3426
|
}
|
|
3427
|
-
drawImage({ x, y }, image,
|
|
3428
|
-
const width = image.width;
|
|
3429
|
-
const height = image.height;
|
|
3427
|
+
drawImage({ x, y }, image, options = {}) {
|
|
3428
|
+
const width = options.width || image.width;
|
|
3429
|
+
const height = options.height || image.height;
|
|
3430
|
+
const angle = options.angle || 0;
|
|
3431
|
+
this.ctx.save();
|
|
3430
3432
|
this.ctx.translate(x, y);
|
|
3431
|
-
if (
|
|
3432
|
-
const angleRad =
|
|
3433
|
+
if (angle) {
|
|
3434
|
+
const angleRad = angle * Math.PI / 180;
|
|
3433
3435
|
this.ctx.rotate(angleRad);
|
|
3434
3436
|
}
|
|
3435
3437
|
this.ctx.drawImage(image, -width / 2, -height / 2, width, height);
|