|
@@ -81,7 +81,7 @@ function parsePoints( points:number[][], width:number, height:number) {
|
|
let n = points.length;
|
|
let n = points.length;
|
|
for(let i=0; i<n; i++) {
|
|
for(let i=0; i<n; i++) {
|
|
const p = points[i]
|
|
const p = points[i]
|
|
-
|
|
|
|
|
|
+
|
|
const x = p[0]*width, y = p[1]*height;
|
|
const x = p[0]*width, y = p[1]*height;
|
|
|
|
|
|
//绘制控制点的位置
|
|
//绘制控制点的位置
|
|
@@ -177,10 +177,10 @@ export const Component = defineComponent({
|
|
//判断是否
|
|
//判断是否
|
|
console.log("dbclick=>xxxxx", ret);
|
|
console.log("dbclick=>xxxxx", ret);
|
|
if (ret.clicked) {//点击删除
|
|
if (ret.clicked) {//点击删除
|
|
- points.splice(ret.index, 1);
|
|
|
|
- if (points.length < 2) {
|
|
|
|
|
|
+ if (points.length < 3) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+ points.splice(ret.index, 1);
|
|
|
|
|
|
} else {
|
|
} else {
|
|
let next = ret.index + 1;
|
|
let next = ret.index + 1;
|
|
@@ -218,7 +218,7 @@ export const Component = defineComponent({
|
|
|
|
|
|
const isDragingIndex = ret.pIndex;
|
|
const isDragingIndex = ret.pIndex;
|
|
|
|
|
|
- const box = controls.selectCtrl.getCurrCardViewPortBox();
|
|
|
|
|
|
+ const box = controls.selectCtrl.getCurrCardBox();
|
|
|
|
|
|
const mvingPoint = !ret.clickCurve && !ret.clickLine
|
|
const mvingPoint = !ret.clickCurve && !ret.clickLine
|
|
let initControlpLen :number | undefined = undefined;
|
|
let initControlpLen :number | undefined = undefined;
|
|
@@ -229,6 +229,7 @@ export const Component = defineComponent({
|
|
|
|
|
|
const obj = controls.selectCtrl.objContainer;
|
|
const obj = controls.selectCtrl.objContainer;
|
|
const cardX = e.clientX - box.left, cardY = e.clientY - box.top;
|
|
const cardX = e.clientX - box.left, cardY = e.clientY - box.top;
|
|
|
|
+
|
|
const p = {x: cardX, y:cardY} as any;
|
|
const p = {x: cardX, y:cardY} as any;
|
|
obj.parent.worldTransform.applyInverse(p, p);
|
|
obj.parent.worldTransform.applyInverse(p, p);
|
|
obj.parent.updateTransform();
|
|
obj.parent.updateTransform();
|
|
@@ -236,7 +237,8 @@ export const Component = defineComponent({
|
|
const x = helper.pxToDesignSize(p.x), y = helper.pxToDesignSize(p.y);
|
|
const x = helper.pxToDesignSize(p.x), y = helper.pxToDesignSize(p.y);
|
|
const offx = ( x - dragingX) / width;
|
|
const offx = ( x - dragingX) / width;
|
|
const offy = ( y - dragingY) / height;
|
|
const offy = ( y - dragingY) / height;
|
|
-
|
|
|
|
|
|
+ console.log("offxxxxxxxxxxxx=>", x);
|
|
|
|
+
|
|
if (ret.moving) {//移动所有
|
|
if (ret.moving) {//移动所有
|
|
points.forEach((p,i)=>{
|
|
points.forEach((p,i)=>{
|
|
p[0] = initPoints[i][0] + offx;
|
|
p[0] = initPoints[i][0] + offx;
|