|
1856 | 1856 | })();
|
1857 | 1857 | (() => {
|
1858 | 1858 | 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'; |
1861 | 1861 | let l = a.stat(0);
|
1862 | 1862 | 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); |
1864 | 1864 | }
|
1865 | 1865 | function d(t) {
|
1866 | 1866 | return n("seed()", "rseed()"), t && a.rseed(t), a.stat(9);
|
1867 | 1867 | }
|
1868 |
| - let c = ""; |
| 1868 | + let p = ""; |
1869 | 1869 | function h(t) {
|
1870 |
| - n("textstyle()", "the 5th param of text()"), c = t; |
| 1870 | + n("textstyle()", "the 5th param of text()"), p = t; |
1871 | 1871 | }
|
1872 | 1872 | let g = a.text;
|
1873 |
| - function f(t, e, s, o = 3, i = c) { |
| 1873 | + function b(t, e, s, o = 3, i = p) { |
1874 | 1874 | g(t, e, s, o, i);
|
1875 | 1875 | }
|
1876 | 1876 | function w(t, e, s, o) {
|
1877 |
| - n("print()", "text()"), f(t, e, s, o); |
| 1877 | + n("print()", "text()"), b(t, e, s, o); |
1878 | 1878 | }
|
1879 | 1879 | function _(t, e) {
|
1880 | 1880 | n("textmetrics()", "ctx().measureText()");
|
1881 | 1881 | 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}`; |
1883 | 1883 | let m = s.measureText(t);
|
1884 | 1884 | return m.height = m.actualBoundingBoxAscent + m.actualBoundingBoxDescent, m;
|
1885 | 1885 | }
|
|
1909 | 1909 | function M(t, e, s, o, i, m, D = true) {
|
1910 | 1910 | return n("transform()", "ctx().setTransform() or ctx().transform()"), a.ctx()[D ? "setTransform" : "transform"](t, e, s, o, i, m);
|
1911 | 1911 | }
|
1912 |
| - function Y() { |
| 1912 | + function S() { |
1913 | 1913 | return n("mousepos()", "MX and MY"), [MX, MY];
|
1914 | 1914 | }
|
1915 |
| - function S(t) { |
| 1915 | + function Y(t) { |
1916 | 1916 | n("setfps()", "framerate()"), a.framerate(t);
|
1917 | 1917 | }
|
1918 | 1918 | let r = a.def;
|
|
1963 | 1963 | let t = stat(5);
|
1964 | 1964 | a.CANVAS.style.backgroundColor = t[~~l.background % t.length];
|
1965 | 1965 | }
|
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 }; |
1967 | 1967 | }
|
1968 |
| - window.pluginMigrate = p; |
| 1968 | + window.pluginMigrate = f; |
1969 | 1969 | })();
|
1970 | 1970 | (() => {
|
1971 | 1971 | function _() {
|
|
0 commit comments