Skip to content

Commit 4cbff8f

Browse files
committed
canvaslite
1 parent fd9a291 commit 4cbff8f

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

examples/CanvasLite.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
* CanvasLite
33
* an html canvas implementation in pure JavaScript
44
*
5-
* @version 0.9.92 (2023-07-31 22:54:20)
5+
* @version 0.9.92r2 (2023-08-02 12:05:01)
66
* https://github.com/foo123/CanvasLite
77
*
88
**//**
99
* CanvasLite
1010
* an html canvas implementation in pure JavaScript
1111
*
12-
* @version 0.9.92 (2023-07-31 22:54:20)
12+
* @version 0.9.92r2 (2023-08-02 12:05:01)
1313
* https://github.com/foo123/CanvasLite
1414
*
1515
**/
@@ -277,7 +277,7 @@ function RenderingContext2D(width, height, set_rgba_at, get_rgba_from)
277277
set: function(c) {
278278
if (c instanceof Gradient || c instanceof Pattern)
279279
{
280-
get_stroke_at = c.getColorAt.bind(c);
280+
get_stroke_at = Rasterizer.getRGBAFrom(c.getColorAt.bind(c));
281281
}
282282
else
283283
{
@@ -292,7 +292,7 @@ function RenderingContext2D(width, height, set_rgba_at, get_rgba_from)
292292
set: function(c) {
293293
if (c instanceof Gradient || c instanceof Pattern)
294294
{
295-
get_fill_at = c.getColorAt.bind(c);
295+
get_fill_at = Rasterizer.getRGBAFrom(c.getColorAt.bind(c));
296296
}
297297
else
298298
{
@@ -6644,7 +6644,7 @@ function CanvasLite(width, height)
66446644
};
66456645
self.toPNG = async function() {
66466646
// only PNG output format
6647-
return await imagepng('binary', imageData.data, imageData.width, imageData.height/*, encoderOptions*/);
6647+
return await imagepng('binary', imageData.data, imageData.width, imageData.height/*, {deflateLevel: 0}*/);
66486648
};
66496649
reset();
66506650
}
@@ -6657,6 +6657,7 @@ CanvasLite[PROTO] = {
66576657
toBlob: null,
66586658
toPNG: null
66596659
};
6660+
CanvasLite.VERSION = "0.9.92r2";
66606661
CanvasLite.Image = Image;
66616662
CanvasLite.RenderingContext2D = Rasterizer.RenderingContext2D;
66626663

0 commit comments

Comments
 (0)