平铺偏移

This commit is contained in:
李志鹏
2026-01-20 16:11:40 +08:00
parent dbd1651a37
commit 844694d638
4 changed files with 8 additions and 5 deletions

View File

@@ -197,11 +197,11 @@
const cwidth = canvas.width;
const cheight = canvas.height;
let image = await urlToCanvas(item.path);
let offsetX = item.location[0];
let offsetY = item.location[1];
let scaleX = ((cwidth / image.width) * item.scale[0]) / 5;
let scaleY = ((cheight / image.height) * item.scale[1]) / 5;
let scale = cwidth > cheight ? scaleX : scaleY;
let offsetX = item.location[0] * cwidth / props.width - (image.width * scale) / 2;
let offsetY = item.location[1] * cheight / props.height - (image.height * scale) / 2;
let angle = item.angle;
let gapX = item.object.gapX;
let gapY = item.object.gapY;