画布双击添加内部图片
This commit is contained in:
@@ -58,11 +58,15 @@
|
||||
</div>
|
||||
<div class="btn" @click="clickflipHorizontal(v)">
|
||||
<i class="iconfont icon-flip-horizontal"></i>
|
||||
<p class="tip">{{ t('Canvas.flipHorizontal') }}</p>
|
||||
<p class="tip">
|
||||
{{ t("Canvas.flipHorizontal") }}
|
||||
</p>
|
||||
</div>
|
||||
<div class="btn" @click="clickflipVertical(v)">
|
||||
<i class="iconfont icon-flip-vertical"></i>
|
||||
<p class="tip">{{ t('Canvas.flipVertical') }}</p>
|
||||
<p class="tip">
|
||||
{{ t("Canvas.flipVertical") }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -225,16 +229,22 @@
|
||||
const initialState = TransformCommand.captureTransformState(obj);
|
||||
const finalState = { ...initialState };
|
||||
const angle = e.target.value;
|
||||
const { x, y } = calculateRotatedTopLeftDeg(
|
||||
obj.width * obj.scaleX,
|
||||
obj.height * obj.scaleY,
|
||||
obj.left,
|
||||
obj.top,
|
||||
obj.angle,
|
||||
angle
|
||||
);
|
||||
finalState.left = x;
|
||||
finalState.top = y;
|
||||
if (obj.originX === "left" && obj.originY === "top") {
|
||||
const width = obj.width * obj.scaleX;
|
||||
const height = obj.height * obj.scaleY;
|
||||
const left = obj.left;
|
||||
const top = obj.top;
|
||||
const { x, y } = calculateRotatedTopLeftDeg(
|
||||
width,
|
||||
height,
|
||||
left,
|
||||
top,
|
||||
obj.angle,
|
||||
angle
|
||||
);
|
||||
finalState.left = x;
|
||||
finalState.top = y;
|
||||
}
|
||||
finalState.angle = angle;
|
||||
transformObject(obj, initialState, finalState);
|
||||
};
|
||||
@@ -257,7 +267,12 @@
|
||||
arrs.forEach((v) => {
|
||||
activeObjects.value.forEach((item) => {
|
||||
if (item.id === v.id) {
|
||||
keys.forEach((key) => (item[key] = v[key]));
|
||||
keys.forEach((k) => {
|
||||
item[k] =
|
||||
typeof v[k] === "number"
|
||||
? Number(v[k].toFixed(3))
|
||||
: v[k];
|
||||
});
|
||||
}
|
||||
});
|
||||
activeObjects.value = [...activeObjects.value];
|
||||
@@ -271,7 +286,6 @@
|
||||
} else {
|
||||
arrs.push(e.target);
|
||||
}
|
||||
console.log(e.target);
|
||||
updateActiveObjects(arrs, ["angle"]);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user