Skip to content

Commit dc95ed5

Browse files
committed
update migrate plugin
1 parent abb823c commit dc95ed5

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

public/litecanvas.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1856,30 +1856,30 @@
18561856
})();
18571857
(() => {
18581858
var v = { mute: false };
1859-
function p(a, b = v) {
1860-
if (a.stat(1)) throw 'Plugin Migrate should be loaded before the "init" event';
1859+
function f(a, c = {}) {
1860+
if (c = Object.assign({}, v, c), a.stat(1)) throw 'Plugin Migrate should be loaded before the "init" event';
18611861
let l = a.stat(0);
18621862
function n(t, e, s = "") {
1863-
b.mute || console.warn(`[Migrate] warning: ${t} is removed. ` + (e ? `Use ${e} instead. ` : "") + s);
1863+
c.mute || console.warn(`[Migrate] warning: ${t} is removed. ` + (e ? `Use ${e} instead. ` : "") + s);
18641864
}
18651865
function d(t) {
18661866
return n("seed()", "rseed()"), t && a.rseed(t), a.stat(9);
18671867
}
1868-
let c = "";
1868+
let p = "";
18691869
function h(t) {
1870-
n("textstyle()", "the 5th param of text()"), c = t;
1870+
n("textstyle()", "the 5th param of text()"), p = t;
18711871
}
18721872
let g = a.text;
1873-
function f(t, e, s, o = 3, i = c) {
1873+
function b(t, e, s, o = 3, i = p) {
18741874
g(t, e, s, o, i);
18751875
}
18761876
function w(t, e, s, o) {
1877-
n("print()", "text()"), f(t, e, s, o);
1877+
n("print()", "text()"), b(t, e, s, o);
18781878
}
18791879
function _(t, e) {
18801880
n("textmetrics()", "ctx().measureText()");
18811881
let s = a.ctx(), o = a.stat(10), i = a.stat(11);
1882-
s.font = `${c || ""} ${~~(e || o)}px ${i}`;
1882+
s.font = `${p || ""} ${~~(e || o)}px ${i}`;
18831883
let m = s.measureText(t);
18841884
return m.height = m.actualBoundingBoxAscent + m.actualBoundingBoxDescent, m;
18851885
}
@@ -1909,10 +1909,10 @@
19091909
function M(t, e, s, o, i, m, D = true) {
19101910
return n("transform()", "ctx().setTransform() or ctx().transform()"), a.ctx()[D ? "setTransform" : "transform"](t, e, s, o, i, m);
19111911
}
1912-
function Y() {
1912+
function S() {
19131913
return n("mousepos()", "MX and MY"), [MX, MY];
19141914
}
1915-
function S(t) {
1915+
function Y(t) {
19161916
n("setfps()", "framerate()"), a.framerate(t);
19171917
}
19181918
let r = a.def;
@@ -1963,9 +1963,9 @@
19631963
let t = stat(5);
19641964
a.CANVAS.style.backgroundColor = t[~~l.background % t.length];
19651965
}
1966-
return { def: u, seed: d, print: w, clear: k, setfps: S, setvar: X, textstyle: h, textmetrics: _, text: f, cliprect: A, clipcirc: E, blendmode: T, transform: M, getcolor: C, mousepos: Y, resize: P };
1966+
return { def: u, seed: d, print: w, clear: k, setfps: Y, setvar: X, textstyle: h, textmetrics: _, text: b, cliprect: A, clipcirc: E, blendmode: T, transform: M, getcolor: C, mousepos: S, resize: P };
19671967
}
1968-
window.pluginMigrate = p;
1968+
window.pluginMigrate = f;
19691969
})();
19701970
(() => {
19711971
function _() {

public/sw.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const cacheName = "luizbills.litecanvas-editor-v1";
2-
const version = "2025.06.20.0";
2+
const version = "2025.06.20.1";
33

44
const precacheResources = [
55
"/",
@@ -29,7 +29,7 @@ const precacheResources = [
2929

3030
self.addEventListener("install", (event) => {
3131
event.waitUntil(
32-
caches.open(cacheName).then((cache) => cache.addAll(precacheResources)),
32+
caches.open(cacheName).then((cache) => cache.addAll(precacheResources))
3333
);
3434
});
3535

@@ -42,7 +42,7 @@ self.addEventListener("fetch", (event) => {
4242
return cachedResponse;
4343
}
4444
return fetch(event.request);
45-
}),
45+
})
4646
);
4747
});
4848

0 commit comments

Comments
 (0)