平铺偏移
This commit is contained in:
@@ -425,6 +425,7 @@ export class PartManager {
|
||||
// this.partGroup.add(path);
|
||||
this.canvas.add(path);
|
||||
this.canvas.renderAll();
|
||||
this.clearPart();
|
||||
}
|
||||
/** 清空点位 */
|
||||
clearPart() {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user