ol 7.0.0-dev.1659218393734 → 7.0.0-dev.1659254427776
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/style/IconImage.d.ts.map +1 -1
- package/style/IconImage.js +11 -30
package/package.json
CHANGED
package/style/IconImage.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconImage.d.ts","sourceRoot":"","sources":["IconImage.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IconImage.d.ts","sourceRoot":"","sources":["IconImage.js"],"names":[],"mappings":"AA4RA;;;;;;;;GAQG;AACH,2BARW,gBAAgB,GAAC,iBAAiB,OAClC,MAAM,QACN,OAAO,YAAY,EAAE,IAAI,eACxB,MAAM,iCAEP,OAAO,aAAa,EAAE,KAAK,GAC1B,SAAS,CASpB;;AA3RD;IACE;;;;;;;OAOG;IACH,mBAPW,gBAAgB,GAAC,iBAAiB,OAClC,MAAM,GAAC,SAAS,QAChB,OAAO,YAAY,EAAE,IAAI,eACxB,MAAM,iCAEP,OAAO,aAAa,EAAE,KAAK,EA+DrC;IA1DC;;;OAGG;IACH,2BAA8B;IAE9B;;;OAGG;IACH,eAAmB;IAEnB;;;OAGG;IACH,qBAA+B;IAE/B;;;OAGG;IACH,gBAAiB;IAEjB;;;OAGG;IACH,eAAmB;IAEnB;;;OAGG;IACH,kBAAqB;IAErB;;;OAGG;IACH,oBAA6B;IAE7B;;;OAGG;IACH,cAAiB;IAEjB;;;OAGG;IACH,aAAe;IAQjB;;OAEG;IACH,yBAKC;IAED;;;OAGG;IACH,mBAeC;IAPK,8BAAqB;IAS3B;;OAEG;IACH,6BAEC;IAED;;OAEG;IACH,0BAIC;IAED;;OAEG;IACH,yBAUC;IAED;;;OAGG;IACH,qBAHW,MAAM,GACL,gBAAgB,GAAC,iBAAiB,CAQ7C;IAED;;;OAGG;IACH,0BAHW,MAAM,GACL,MAAM,CAKjB;IAED;;OAEG;IACH,qBAEC;IAED;;OAEG;IACH,wBAFY,gBAAgB,GAAC,iBAAiB,CAkB7C;IAED;;;OAGG;IACH,WAFY,OAAO,YAAY,EAAE,IAAI,CAIpC;IAED;;OAEG;IACH,UAFY,MAAM,GAAC,SAAS,CAI3B;IAED;;OAEG;IACH,aAmBC;IAED;;;OAGG;IACH,sBA0BC;IAED;;;;OAIG;IACH,uBAKC;CACF"}
|
package/style/IconImage.js
CHANGED
|
@@ -250,42 +250,23 @@ class IconImage extends EventTarget {
|
|
|
250
250
|
return;
|
|
251
251
|
}
|
|
252
252
|
|
|
253
|
+
const image = this.image_;
|
|
253
254
|
const canvas = document.createElement('canvas');
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
canvas.width = Math.ceil(this.image_.width * pixelRatio);
|
|
257
|
-
canvas.height = Math.ceil(this.image_.height * pixelRatio);
|
|
255
|
+
canvas.width = Math.ceil(image.width * pixelRatio);
|
|
256
|
+
canvas.height = Math.ceil(image.height * pixelRatio);
|
|
258
257
|
|
|
259
258
|
const ctx = canvas.getContext('2d');
|
|
260
259
|
ctx.scale(pixelRatio, pixelRatio);
|
|
261
|
-
ctx.drawImage(
|
|
260
|
+
ctx.drawImage(image, 0, 0);
|
|
262
261
|
|
|
263
262
|
ctx.globalCompositeOperation = 'multiply';
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
ctx.globalCompositeOperation = 'destination-in';
|
|
272
|
-
ctx.drawImage(this.image_, 0, 0);
|
|
273
|
-
} else {
|
|
274
|
-
const imgData = ctx.getImageData(0, 0, canvas.width, canvas.height);
|
|
275
|
-
const data = imgData.data;
|
|
276
|
-
const r = this.color_[0] / 255.0;
|
|
277
|
-
const g = this.color_[1] / 255.0;
|
|
278
|
-
const b = this.color_[2] / 255.0;
|
|
279
|
-
const a = this.color_[3];
|
|
280
|
-
|
|
281
|
-
for (let i = 0, ii = data.length; i < ii; i += 4) {
|
|
282
|
-
data[i] *= r;
|
|
283
|
-
data[i + 1] *= g;
|
|
284
|
-
data[i + 2] *= b;
|
|
285
|
-
data[i + 3] *= a;
|
|
286
|
-
}
|
|
287
|
-
ctx.putImageData(imgData, 0, 0);
|
|
288
|
-
}
|
|
263
|
+
ctx.fillStyle = asString(this.color_);
|
|
264
|
+
ctx.fillRect(0, 0, canvas.width / pixelRatio, canvas.height / pixelRatio);
|
|
265
|
+
|
|
266
|
+
ctx.globalCompositeOperation = 'destination-in';
|
|
267
|
+
ctx.drawImage(image, 0, 0);
|
|
268
|
+
|
|
269
|
+
this.canvas_[pixelRatio] = canvas;
|
|
289
270
|
}
|
|
290
271
|
|
|
291
272
|
/**
|