@novely/solid-renderer 0.27.0 → 0.27.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.jsx +8 -4
- package/package.json +1 -1
package/dist/index.jsx
CHANGED
|
@@ -4683,8 +4683,11 @@ var canvasDrawImages = (canvas = createCanvas(), ctx = getContext(canvas), image
|
|
|
4683
4683
|
const draw = () => {
|
|
4684
4684
|
if (!set) {
|
|
4685
4685
|
set = true;
|
|
4686
|
-
canvas.
|
|
4687
|
-
|
|
4686
|
+
if (canvas.dataset.resized === "false") {
|
|
4687
|
+
canvas.width = image.naturalWidth;
|
|
4688
|
+
canvas.height = image.naturalHeight;
|
|
4689
|
+
canvas.dataset.resized = "true";
|
|
4690
|
+
}
|
|
4688
4691
|
}
|
|
4689
4692
|
ctx.drawImage(image, 0, 0);
|
|
4690
4693
|
image.removeEventListener("load", draw);
|
|
@@ -6145,14 +6148,13 @@ var SHOW_ARBITARY_CHARACTER = Symbol();
|
|
|
6145
6148
|
var createShowArbitraryCharacterAction = (_) => {
|
|
6146
6149
|
const showArbitraryCharacter = (params) => {
|
|
6147
6150
|
const handler = ({ get }) => {
|
|
6148
|
-
const {
|
|
6151
|
+
const { __internals } = get(false);
|
|
6149
6152
|
const { ctx } = __internals;
|
|
6150
6153
|
const handle = ctx.character(params.id);
|
|
6151
6154
|
handle.append(params.classes, params.style, ctx.meta.restoring);
|
|
6152
6155
|
handle.emotion(params.emotion, true);
|
|
6153
6156
|
const extension = ((e) => Array.isArray(e) ? e : [e])(params.extendWith());
|
|
6154
6157
|
canvasDrawImages(handle.canvas, handle.ctx, extension.map((src) => PRELOADED_IMAGE_MAP.get(src) || createImage(src)));
|
|
6155
|
-
clear(() => handle.ctx.clearRect(0, 0, handle.canvas.width, handle.canvas.height));
|
|
6156
6158
|
};
|
|
6157
6159
|
handler.id = SHOW_ARBITARY_CHARACTER;
|
|
6158
6160
|
handler.key = params.id;
|
|
@@ -6234,6 +6236,8 @@ var createSolidRenderer = ({
|
|
|
6234
6236
|
});
|
|
6235
6237
|
}
|
|
6236
6238
|
if (shouldRender && stored) {
|
|
6239
|
+
canvasContext.clearRect(0, 0, canvas.width, canvas.height);
|
|
6240
|
+
canvas.dataset.resized = "false";
|
|
6237
6241
|
canvasDrawImages(canvas, canvasContext, stored);
|
|
6238
6242
|
}
|
|
6239
6243
|
},
|