@meta2d/core 1.0.97 → 1.0.98
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/package.json +1 -1
- package/src/canvas/canvas.js +1 -0
- package/src/canvas/canvas.js.map +1 -1
- package/src/core.js +23 -10
- package/src/core.js.map +1 -1
- package/src/pen/render.js +5 -5
- package/src/pen/render.js.map +1 -1
package/src/pen/render.js
CHANGED
|
@@ -637,13 +637,13 @@ function linearGradient(ctx, worldRect, fromColor, toColor, angle) {
|
|
|
637
637
|
* @param pen 画笔
|
|
638
638
|
*/
|
|
639
639
|
function getImagePosition(pen) {
|
|
640
|
-
const { worldIconRect: rect, iconWidth, iconHeight, imgNaturalWidth, imgNaturalHeight, } = pen.calculative;
|
|
640
|
+
const { worldIconRect: rect, iconWidth, iconHeight, imgNaturalWidth, imgNaturalHeight, worldRect } = pen.calculative;
|
|
641
641
|
if (!rect) {
|
|
642
642
|
return {
|
|
643
|
-
x:
|
|
644
|
-
y:
|
|
645
|
-
width: imgNaturalWidth || pen.calculative.img.naturalWidth,
|
|
646
|
-
height: imgNaturalHeight || pen.calculative.img.naturalHeight,
|
|
643
|
+
x: worldRect.x,
|
|
644
|
+
y: worldRect.y,
|
|
645
|
+
width: worldRect.width || imgNaturalWidth || pen.calculative.img.naturalWidth,
|
|
646
|
+
height: worldRect.width || imgNaturalHeight || pen.calculative.img.naturalHeight,
|
|
647
647
|
};
|
|
648
648
|
}
|
|
649
649
|
;
|