Skip to content

Commit

Permalink
v.0.9.92r2
Browse files Browse the repository at this point in the history
* fix gradient/pattern in strokeStyle/fillStyle
  • Loading branch information
foo123 committed Aug 2, 2023
1 parent 961267a commit b42f21c
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

An html canvas implementation in pure JavaScript

**version: 0.9.92** (71 kB minified)
**version: 0.9.92r2** (71 kB minified)

**Uses:**

Expand Down
2 changes: 1 addition & 1 deletion beeld.config
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ tasks =[{}]
header = ./src/header.js

replace =[{}]
"@@VERSION@@" = "0.9.92"
"@@VERSION@@" = "0.9.92r2"
"@@DATE@@" = Xpresion::date("Y-m-d H:i:s")
@

Expand Down
11 changes: 6 additions & 5 deletions build/CanvasLite.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
* CanvasLite
* an html canvas implementation in pure JavaScript
*
* @version 0.9.92 (2023-07-31 22:54:20)
* @version 0.9.92r2 (2023-08-02 12:05:01)
* https://github.com/foo123/CanvasLite
*
**//**
* CanvasLite
* an html canvas implementation in pure JavaScript
*
* @version 0.9.92 (2023-07-31 22:54:20)
* @version 0.9.92r2 (2023-08-02 12:05:01)
* https://github.com/foo123/CanvasLite
*
**/
Expand Down Expand Up @@ -277,7 +277,7 @@ function RenderingContext2D(width, height, set_rgba_at, get_rgba_from)
set: function(c) {
if (c instanceof Gradient || c instanceof Pattern)
{
get_stroke_at = c.getColorAt.bind(c);
get_stroke_at = Rasterizer.getRGBAFrom(c.getColorAt.bind(c));
}
else
{
Expand All @@ -292,7 +292,7 @@ function RenderingContext2D(width, height, set_rgba_at, get_rgba_from)
set: function(c) {
if (c instanceof Gradient || c instanceof Pattern)
{
get_fill_at = c.getColorAt.bind(c);
get_fill_at = Rasterizer.getRGBAFrom(c.getColorAt.bind(c));
}
else
{
Expand Down Expand Up @@ -6644,7 +6644,7 @@ function CanvasLite(width, height)
};
self.toPNG = async function() {
// only PNG output format
return await imagepng('binary', imageData.data, imageData.width, imageData.height/*, encoderOptions*/);
return await imagepng('binary', imageData.data, imageData.width, imageData.height/*, {deflateLevel: 0}*/);
};
reset();
}
Expand All @@ -6657,6 +6657,7 @@ CanvasLite[PROTO] = {
toBlob: null,
toPNG: null
};
CanvasLite.VERSION = "0.9.92r2";
CanvasLite.Image = Image;
CanvasLite.RenderingContext2D = Rasterizer.RenderingContext2D;

Expand Down
4 changes: 2 additions & 2 deletions build/CanvasLite.min.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/CanvasLite.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function CanvasLite(width, height)
};
self.toPNG = async function() {
// only PNG output format
return await imagepng('binary', imageData.data, imageData.width, imageData.height/*, encoderOptions*/);
return await imagepng('binary', imageData.data, imageData.width, imageData.height/*, {deflateLevel: 0}*/);
};
reset();
}
Expand All @@ -85,5 +85,6 @@ CanvasLite[PROTO] = {
toBlob: null,
toPNG: null
};
CanvasLite.VERSION = "@@VERSION@@";
CanvasLite.Image = Image;
CanvasLite.RenderingContext2D = Rasterizer.RenderingContext2D;
4 changes: 2 additions & 2 deletions src/Rasterizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ function RenderingContext2D(width, height, set_rgba_at, get_rgba_from)
set: function(c) {
if (c instanceof Gradient || c instanceof Pattern)
{
get_stroke_at = c.getColorAt.bind(c);
get_stroke_at = Rasterizer.getRGBAFrom(c.getColorAt.bind(c));
}
else
{
Expand All @@ -248,7 +248,7 @@ function RenderingContext2D(width, height, set_rgba_at, get_rgba_from)
set: function(c) {
if (c instanceof Gradient || c instanceof Pattern)
{
get_fill_at = c.getColorAt.bind(c);
get_fill_at = Rasterizer.getRGBAFrom(c.getColorAt.bind(c));
}
else
{
Expand Down
Binary file modified test/peacecolor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/peacecolor2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b42f21c

Please sign in to comment.