Skip to content

Commit e572c07

Browse files
committed
update pluginMigrate
1 parent 06cc6c3 commit e572c07

File tree

2 files changed

+29
-30
lines changed

2 files changed

+29
-30
lines changed

public/litecanvas.js

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1987,15 +1987,14 @@
19871987
};
19881988
var _ = (a, c, m, l, s, h, f, b) => (o(isFinite(a), "colrect: 1st param must be a number"), o(isFinite(c), "colrect: 2nd param must be a number"), o(isFinite(m), "colrect: 3rd param must be a number"), o(isFinite(l), "colrect: 4th param must be a number"), o(isFinite(s), "colrect: 5th param must be a number"), o(isFinite(h), "colrect: 6th param must be a number"), o(isFinite(f), "colrect: 7th param must be a number"), o(isFinite(b), "colrect: 8th param must be a number"), a < s + f && a + m > s && c < h + b && c + l > h);
19891989
var x = (a, c, m, l, s, h) => (o(isFinite(a), "colcirc: 1st param must be a number"), o(isFinite(c), "colcirc: 2nd param must be a number"), o(isFinite(m), "colcirc: 3rd param must be a number"), o(isFinite(l), "colcirc: 4th param must be a number"), o(isFinite(s), "colcirc: 5th param must be a number"), o(isFinite(h), "colcirc: 6th param must be a number"), (l - a) * (l - a) + (s - c) * (s - c) <= (m + h) * (m + h));
1990-
var Et = 2 * Math.PI;
1991-
var he = Math.PI / 2;
1992-
var $ = 4, fe = 1 << $, V = 8, de = 1 << V;
1993-
var j = { warnings: true };
1990+
var wt = 2 * Math.PI;
1991+
var oe = Math.PI / 2;
1992+
var Z = { warnings: true };
19941993
function g(a, c = {}) {
1995-
if (c = Object.assign({}, j, c), a.stat(1)) throw 'Plugin Migrate should be loaded before the "init" event';
1994+
if (c = Object.assign({}, Z, c), a.stat(1)) throw 'Plugin Migrate should be loaded before the "init" event';
19961995
let l = a.stat(0);
19971996
function s(t, e, r = "") {
1998-
c.warnings && console.warn(`[migrate] ${t} is removed. ` + (e ? `Use ${e} instead. ` : "") + r);
1997+
c.warnings && console.warn(`[litecanvas/migrate] ${t} is removed. ` + (e ? `Use ${e} instead. ` : "") + r);
19991998
}
20001999
function h(t) {
20012000
return s("seed()", "rseed()"), t && a.rseed(t), a.stat(9);
@@ -2005,20 +2004,20 @@
20052004
s("textstyle()", "the 5th param of text()"), f = t;
20062005
}
20072006
let w = a.text;
2008-
function y(t, e, r, i = 3, p = f) {
2007+
function v(t, e, r, i = 3, p = f) {
20092008
w(t, e, r, i, p);
20102009
}
2011-
function M(t, e, r, i) {
2012-
s("print()", "text()"), y(t, e, r, i);
2010+
function E(t, e, r, i) {
2011+
s("print()", "text()"), v(t, e, r, i);
20132012
}
2014-
function E(t, e) {
2013+
function M(t, e) {
20152014
s("textmetrics()", "ctx().measureText()");
20162015
let r = a.ctx(), i = a.stat(10), p = a.stat(11);
20172016
r.font = `${f || ""} ${~~(e || i)}px ${p}`;
20182017
let d = r.measureText(t);
20192018
return d.height = d.actualBoundingBoxAscent + d.actualBoundingBoxDescent, d;
20202019
}
2021-
function T(t, e, r, i) {
2020+
function I(t, e, r, i) {
20222021
s("cliprect()", "clip()");
20232022
let p = a.ctx();
20242023
p.beginPath(), p.rect(t, e, r, i), p.clip();
@@ -2028,26 +2027,26 @@
20282027
let i = a.ctx();
20292028
i.beginPath(), i.arc(t, e, r, 0, a.TWO_PI), i.clip();
20302029
}
2031-
function C(t) {
2030+
function T(t) {
20322031
s("getcolor()", "stat(5)");
20332032
let e = stat(5);
20342033
return e[~~t % e.length];
20352034
}
2036-
function k(t) {
2035+
function P(t) {
20372036
s("blendmode()", "ctx().globalCompositeOperation");
20382037
let e = a.ctx();
20392038
e.globalCompositeOperation = t;
20402039
}
2041-
function I(t) {
2040+
function R(t) {
20422041
s("clear()", "cls()"), a.cls(t);
20432042
}
2044-
function S(t, e, r, i, p, d, B = true) {
2045-
return s("transform()", "ctx().setTransform() or ctx().transform()"), a.ctx()[B ? "setTransform" : "transform"](t, e, r, i, p, d);
2043+
function C(t, e, r, i, p, d, D = true) {
2044+
return s("transform()", "ctx().setTransform() or ctx().transform()"), a.ctx()[D ? "setTransform" : "transform"](t, e, r, i, p, d);
20462045
}
2047-
function P() {
2046+
function S() {
20482047
return s("mousepos()", "MX and MY"), [MX, MY];
20492048
}
2050-
function O(t) {
2049+
function k(t) {
20512050
s("setfps()", "framerate()"), a.framerate(t);
20522051
}
20532052
let n = a.def;
@@ -2089,12 +2088,12 @@
20892088
function L(t, e) {
20902089
s("setvar()", "def()"), u(t, e);
20912090
}
2092-
a.listen("resized", v);
2093-
function v() {
2091+
a.listen("resized", y);
2092+
function y() {
20942093
u("CX", a.W / 2), u("CY", a.H / 2);
20952094
}
2096-
v(), u("CANVAS", a.canvas());
2097-
function R(t, e) {
2095+
y(), u("CANVAS", a.canvas());
2096+
function N(t, e) {
20982097
if (l.autoscale) throw "resize() don't works with autoscale enabled";
20992098
s("resize()", null, "Avoid changing the canvas dimensions at runtime."), a.CANVAS.width = t, u("W", t), u("CX", t / 2), a.CANVAS.height = e, u("H", e), u("CY", e / 2), a.emit("resized", 1);
21002099
}
@@ -2103,11 +2102,11 @@
21032102
let t = stat(5);
21042103
a.CANVAS.style.backgroundColor = t[~~l.background % t.length];
21052104
}
2106-
function F(t) {
2105+
function O(t) {
21072106
return s("path()", "`new Path2D`", "See https://developer.mozilla.org/en-US/docs/Web/API/Path2D"), new Path2D(t);
21082107
}
21092108
let z = a.fill;
2110-
function N(t, e) {
2109+
function F(t, e) {
21112110
if (e instanceof Path2D) {
21122111
s("fill(color, path)");
21132112
let r = a.stat(5), i = a.ctx();
@@ -2122,11 +2121,11 @@
21222121
i.strokeStyle = r[~~t % r.length], a.ctx().stroke(e);
21232122
} else Y(t);
21242123
}
2125-
let X = a.clip;
2126-
function D(t) {
2127-
s("clip(path)", "clip(callback)", "E.g: `clip((ctx) => ctx.rect(0, 0, 200, 200))`"), t instanceof Path2D ? a.ctx().clip(t) : X(t);
2124+
let W = a.clip;
2125+
function B(t) {
2126+
s("clip(path)", "clip(callback)", "E.g: `clip((ctx) => ctx.rect(0, 0, 200, 200))`"), t instanceof Path2D ? a.ctx().clip(t) : W(t);
21282127
}
2129-
return { def: u, seed: h, print: M, clear: I, setfps: O, setvar: L, textstyle: b, textmetrics: E, text: y, cliprect: T, clipcirc: A, blendmode: k, transform: S, getcolor: C, mousepos: P, resize: R, path: F, fill: N, stroke: H, clip: D, colrect: _, colcirc: x };
2128+
return l.antialias && s('"antialias" option', '"pixelart" option'), { def: u, seed: h, print: E, clear: R, setfps: k, setvar: L, textstyle: b, textmetrics: M, text: v, cliprect: I, clipcirc: A, blendmode: P, transform: C, getcolor: T, mousepos: S, resize: N, path: O, fill: F, stroke: H, clip: B, colrect: _, colcirc: x };
21302129
}
21312130
window.pluginMigrate = g;
21322131
})();
@@ -2249,6 +2248,6 @@
22492248
})();
22502249
/*! @litecanvas/utils by Luiz Bills | MIT Licensed */
22512250
/*! Asset Loader plugin for litecanvas by Luiz Bills | MIT Licensed */
2252-
/*! pluginMigrate for litecanvas by Luiz Bills | MIT Licensed */
2251+
/*! Migrate for litecanvas by Luiz Bills | MIT Licensed */
22532252
/*! pluginFrameRateMeter for litecanvas by Luiz Bills | MIT Licensed */
22542253
/*! Plugin Pixel Font for litecanvas by Luiz Bills | MIT Licensed */

public/sw.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const cacheName = "luizbills.litecanvas-editor-v1";
2-
const version = "2025.7.18.0";
2+
const version = "2025.7.18.1";
33

44
const precacheResources = [
55
"/",

0 commit comments

Comments
 (0)