Commit daeca6f5 authored by 任建锋's avatar 任建锋

--

parent 25a47f09
.zero-playground-body-center{ .zero-playground-body-center{
position: relative; position: relative;
width: 750px; width: 750px;
height: 1206px; height: 1624px;
margin: 10px auto; margin: 10px auto;
// max-height: 1200px; // max-height: 1200px;
background-color: transparent; background-color: transparent;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.4); box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
overflow-x: hidden; //overflow-x: hidden;
overflow-y: auto; //overflow-y: auto;
/*transform: scale(.5, .5); /*transform: scale(.5, .5);
transform-origin: 50% 0%;*/ transform-origin: 50% 0%;*/
//zoom: 0.5; //zoom: 0.5;
......
<template> <template>
<pane icon="el-icon-s-open" class="pane-playground" :title="$t('panes.Playground')"> <pane icon="el-icon-s-open" class="pane-playground" :title="$t('panes.Playground')">
<div class="zero-playground-body-center" :style="playgroundStyle">
<div class="draw-body">
<div class="playground-con">
<!-- <label class="el-form-item__label">滑动滚轮进行缩放</label> -->
<el-button size="mini" @click="setZoom(true)"><i class="el-icon-plus"></i></el-button>
<el-input class="el-input el-input--mini" :value="parseInt(zoom*100)+'%'" style="width:60px" readonly/>
<el-button size="mini" @click="setZoom(false)"><i class="el-icon-minus"></i></el-button>
</div>
<div class="zero-playground-body-center" :style="playgroundStyle" >
<!-- <div class="zero-playground-draw-panel"> --> <!-- <div class="zero-playground-draw-panel"> -->
<draw-canvas-panel></draw-canvas-panel> <draw-canvas-panel></draw-canvas-panel>
<!-- </div> --> <!-- </div> -->
</div> </div>
</div>
</pane> </pane>
</template> </template>
...@@ -18,21 +28,51 @@ export default { ...@@ -18,21 +28,51 @@ export default {
name: 'Playground', name: 'Playground',
components: { Pane, DrawPanel,DrawCanvasPanel}, components: { Pane, DrawPanel,DrawCanvasPanel},
props: { props: {
zoom:0.5
}, },
data:{
data () {
return {
zoom:0.5,
hasCtrlState:false
}
}, },
methods: { methods: {
mouseWheel(e){ mouseWheel(e){
console.log(e) console.log(e)
console.log(this.hasCtrlState)
if(!this.hasCtrlState){
return;
}
if(e.deltaY>0){ if(e.deltaY>0){
this.zoom-=0.1 this.setZoom(false)
}else if(e.deltaY<0){ }else if(e.deltaY<0){
this.zoom+=0.1 this.setZoom(true)
} }
console.log(this.zoom) console.log(this.zoom)
// this.$set(this.zoom, this.zoomj)
},
setZoom(state){
if(state){
if(this.zoom>=1.4){
this.zoom=1.4
}else{
this.zoom+=0.05
}
}else{
if(this.zoom<=0.2){
this.zoom=0.2
}else{
this.zoom-=0.05
}
}
// this.zoom=this.zoom.toFixed(2)
events.$emit('setPlaygroundZoom', {zoom:this.zoom}); events.$emit('setPlaygroundZoom', {zoom:this.zoom});
},
keyDo(state){
console.log(state)
this.hasCtrlState=state;
} }
}, },
computed: { computed: {
...@@ -48,13 +88,46 @@ export default { ...@@ -48,13 +88,46 @@ export default {
created(){ created(){
//alert() //alert()
this.zoom=0.5; this.zoom=0.5;
document.body.addEventListener('mousewheel',(e)=>{ document.body.addEventListener('mousewheel',(e)=>{
this.mouseWheel(e) this.mouseWheel(e)
},false) },false)
document.onkeydown = (e)=>{
let key = window.event.keyCode;
if (key == 18) {
this.keyDo(true);
}
};
document.onkeyup = (e)=>{
let key = window.event.keyCode;
if (key == 18) {
this.keyDo(false);
}
};
},
mounted(){
events.$emit('setPlaygroundZoom', {zoom:this.zoom});
console.log(123)
} }
}; };
</script> </script>
<style scoped> <style scoped>
</style> </style>
<style lang="scss">
.pane-playground{
}
.draw-body{
width:100%;
height: 100%;
overflow: auto;
}
.playground-con{
width: 100%;
height: 50px;
}
</style>
\ No newline at end of file
<template> <template>
<div class="edit-control-view" @mousedown="moveEdit($event,`mousedown`)"> <div class="edit-control-view" @mousedown="moveEdit($event,`mousedown`)">
<!-- <div class="edit-box-con-body" :style="boxstyleEdit">
</div> -->
<div class="edit-con-body" :style="styleEdit"> <div class="edit-con-body" :style="styleEdit">
<div class="edit-con-move" @mousedown="editStateCon(`move`)"></div> <div class="edit-con-move" @mousedown="editStateCon(`move`)"></div>
<div class="edit-con-com edit-left-con" @mousedown="editStateCon(`left`)"></div> <div class="edit-con-com edit-left-con" @mousedown="editStateCon(`left`)"></div>
...@@ -20,6 +24,7 @@ ...@@ -20,6 +24,7 @@
></div> ></div>
</div> </div>
</div> </div>
</template> </template>
...@@ -35,7 +40,11 @@ export default { ...@@ -35,7 +40,11 @@ export default {
}, },
activeComponent: {} activeComponent: {}
}, },
data: { data () {
return {
styleCatch:{},
boxStyleCatch:{},
canMove: false, canMove: false,
editEvent: "", editEvent: "",
changeWidth: 0, changeWidth: 0,
...@@ -50,7 +59,10 @@ export default { ...@@ -50,7 +59,10 @@ export default {
catchHeight: 0, catchHeight: 0,
catchX:0, catchX:0,
catchY:0, catchY:0,
zoom:2
}
}, },
components: {}, components: {},
methods: { methods: {
moveEdit(e, type) { moveEdit(e, type) {
...@@ -91,152 +103,182 @@ export default { ...@@ -91,152 +103,182 @@ export default {
this.catchHeight=0; this.catchHeight=0;
this.catchY=0; this.catchY=0;
this.catchY=0; this.catchY=0;
//this.styleCatch=this.activeComponent.properties;
// this.boxStyleCatch=this.activeComponent.properties;
} }
} }
}, },
catchWidthCon() { catchWidthCon() {
if (this.editEvent == "bottomright") { if (this.editEvent == "bottomright") {
this.catchWidth = this.activeComponent.properties.width; this.catchWidth = this.styleCatch.width? this.styleCatch.width:0;
this.catchHeight = this.activeComponent.properties.height; this.catchHeight = this.styleCatch.height? this.styleCatch.height:0;
}else if (this.editEvent == "topright") { }else if (this.editEvent == "topright") {
this.catchWidth = this.activeComponent.properties.width; this.catchWidth = this.styleCatch.width? this.styleCatch.width:0;
this.catchHeight = this.activeComponent.properties.height; this.catchHeight = this.styleCatch.height? this.styleCatch.height:0;
this.catchY = this.activeComponent.properties.y; this.catchY = this.styleCatch.y? this.styleCatch.y:0;
}else if (this.editEvent == "top") { }else if (this.editEvent == "top") {
this.catchHeight = this.activeComponent.properties.height; this.catchHeight = this.styleCatch.height? this.styleCatch.height:0;
this.catchY = this.activeComponent.properties.y; this.catchY = this.styleCatch.y? this.styleCatch.y:0;
}else if (this.editEvent == "right") { }else if (this.editEvent == "right") {
this.catchWidth = this.activeComponent.properties.width; this.catchWidth = this.styleCatch.width? this.styleCatch.width:0;
this.catchY = this.activeComponent.properties.y; this.catchY = this.styleCatch.y? this.styleCatch.y:0;
} else if (this.editEvent == "left") { } else if (this.editEvent == "left") {
this.catchWidth = this.activeComponent.properties.width; this.catchWidth = this.styleCatch.width? this.styleCatch.width:0;
this.catchX = this.activeComponent.properties.x; this.catchX = this.styleCatch.x? this.styleCatch.x:0;
} else if (this.editEvent == "bottom") { } else if (this.editEvent == "bottom") {
this.catchHeight = this.activeComponent.properties.height; this.catchHeight = this.styleCatch.height? this.styleCatch.height:0;
} else if (this.editEvent == "topleft") { } else if (this.editEvent == "topleft") {
this.catchWidth = this.activeComponent.properties.width; this.catchWidth = this.styleCatch.width? this.styleCatch.width:0;
this.catchHeight = this.activeComponent.properties.height; this.catchHeight = this.styleCatch.height? this.styleCatch.height:0;
this.catchY = this.activeComponent.properties.y; this.catchY = this.styleCatch.y? this.styleCatch.y:0;
this.catchX = this.activeComponent.properties.x; this.catchX = this.styleCatch.x? this.styleCatch.x:0;
} else if (this.editEvent == "bottomleft") { } else if (this.editEvent == "bottomleft") {
this.catchWidth = this.activeComponent.properties.width; this.catchWidth = this.styleCatch.width? this.styleCatch.width:0;
this.catchHeight = this.activeComponent.properties.height; this.catchHeight = this.styleCatch.height? this.styleCatch.height:0;
this.catchX = this.activeComponent.properties.x; this.catchX = this.styleCatch.x? this.styleCatch.x:0;
} else if (this.editEvent == "center") { } else if (this.editEvent == "center") {
this.catchWidth = this.activeComponent.properties.anchorX; this.catchWidth = this.styleCatch.anchorX? this.styleCatch.anchorX:0;
this.catchHeight = this.activeComponent.properties.anchorY; this.catchHeight = this.styleCatch.anchorY? this.styleCatch.anchorY:0;
} else if (this.editEvent == "move") { } else if (this.editEvent == "move") {
this.catchX = this.activeComponent.properties.x; this.catchX = this.styleCatch.x? this.styleCatch.x:0;
this.catchY = this.activeComponent.properties.y; this.catchY = this.styleCatch.y? this.styleCatch.y:0;
} }
}, },
modifyCopyPropertiesCon() { modifyCopyPropertiesCon() {
if (this.editEvent == "bottomright") { if (this.editEvent == "bottomright") {
this.$store.dispatch("modifyCopyProperties", { // this.$store.dispatch("modifyCopyProperties", {
width: this.catchWidth + this.changeMoveX * 2, // width: this.catchWidth + this.changeMoveX * this.zoom,
height: this.catchHeight + this.changeMoveY * 2 // height: this.catchHeight + this.changeMoveY * this.zoom
}); // });
this.boxStyleCatch.width=this.catchWidth + this.changeMoveX * this.zoom
this.boxStyleCatch.height=this.catchHeight + this.changeMoveY * this.zoom
} else if (this.editEvent == "top") { } else if (this.editEvent == "top") {
this.$store.dispatch("modifyCopyProperties", {
height: this.catchHeight - this.changeMoveY * 2, // this.$store.dispatch("modifyCopyProperties", {
y:this.catchY+this.changeMoveY * 2 // height: this.catchHeight - this.changeMoveY * this.zoom,
}); // y:this.catchY+this.changeMoveY * this.zoom
// });
this.boxStyleCatch.height=this.catchHeight - this.changeMoveY * this.zoom;
this.boxStyleCatch.y=this.catchY+this.changeMoveY * this.zoom
} else if (this.editEvent == "right") { } else if (this.editEvent == "right") {
this.$store.dispatch("modifyCopyProperties", { // this.$store.dispatch("modifyCopyProperties", {
width: this.catchWidth + this.changeMoveX * 2, // width: this.catchWidth + this.changeMoveX * this.zoom,
}); // });
this.boxStyleCatch.width=this.catchWidth + this.changeMoveX * this.zoom;
} else if (this.editEvent == "left") { } else if (this.editEvent == "left") {
this.$store.dispatch("modifyCopyProperties", { // this.$store.dispatch("modifyCopyProperties", {
width: this.catchWidth - this.changeMoveX * 2, // width: this.catchWidth - this.changeMoveX * this.zoom,
x:this.catchX+this.changeMoveX * 2 // x:this.catchX+this.changeMoveX * this.zoom
}); // });
this.boxStyleCatch.width=this.catchWidth - this.changeMoveX * this.zoom
this.boxStyleCatch.x=this.catchX+this.changeMoveX * this.zoom
} else if (this.editEvent == "bottom") { } else if (this.editEvent == "bottom") {
this.$store.dispatch("modifyCopyProperties", { // this.$store.dispatch("modifyCopyProperties", {
height: this.catchHeight + this.changeMoveY * 2, // height: this.catchHeight + this.changeMoveY * this.zoom,
}); // });
this.boxStyleCatch.height=this.catchHeight + this.changeMoveY * this.zoom
} else if (this.editEvent == "topright") { } else if (this.editEvent == "topright") {
this.$store.dispatch("modifyCopyProperties", { // this.$store.dispatch("modifyCopyProperties", {
width: this.catchWidth + this.changeMoveX * 2, // width: this.catchWidth + this.changeMoveX * this.zoom,
height: this.catchHeight - this.changeMoveY * 2, // height: this.catchHeight - this.changeMoveY * this.zoom,
y:this.catchY+this.changeMoveY * 2 // y:this.catchY+this.changeMoveY * this.zoom
}); // });
this.boxStyleCatch.width=this.catchWidth + this.changeMoveX * this.zoom
this.boxStyleCatch.height=this.catchHeight - this.changeMoveY * this.zoom
this.boxStyleCatch.y=this.catchY+this.changeMoveY * this.zoom
} else if (this.editEvent == "topleft") { } else if (this.editEvent == "topleft") {
this.$store.dispatch("modifyCopyProperties", { // this.$store.dispatch("modifyCopyProperties", {
width: this.catchWidth - this.changeMoveX * 2, // width: this.catchWidth - this.changeMoveX * this.zoom,
height: this.catchHeight - this.changeMoveY * 2, // height: this.catchHeight - this.changeMoveY * this.zoom,
y:this.catchY+this.changeMoveY * 2, // y:this.catchY+this.changeMoveY * this.zoom,
x:this.catchX+this.changeMoveX * 2 // x:this.catchX+this.changeMoveX * this.zoom
}); // });
this.boxStyleCatch.width=this.catchWidth - this.changeMoveX * this.zoom
this.boxStyleCatch.height=this.catchHeight - this.changeMoveY * this.zoom
this.boxStyleCatch.y=this.catchY+this.changeMoveY * this.zoom
this.boxStyleCatch.x=this.catchX+this.changeMoveX * this.zoom
} else if (this.editEvent == "bottomleft") { } else if (this.editEvent == "bottomleft") {
this.$store.dispatch("modifyCopyProperties", { // this.$store.dispatch("modifyCopyProperties", {
width: this.catchWidth - this.changeMoveX * 2, // width: this.catchWidth - this.changeMoveX * this.zoom,
height: this.catchHeight + this.changeMoveY * 2, // height: this.catchHeight + this.changeMoveY * this.zoom,
x:this.catchX+this.changeMoveX * 2 // x:this.catchX+this.changeMoveX * this.zoom
}); // });
this.boxStyleCatch.width=this.catchWidth - this.changeMoveX * this.zoom
this.boxStyleCatch.height=this.catchHeight + this.changeMoveY * this.zoom
this.boxStyleCatch.x=this.catchX+this.changeMoveX * this.zoom
} else if (this.editEvent == "center") { } else if (this.editEvent == "center") {
this.$store.dispatch("modifyCopyProperties", { // this.$store.dispatch("modifyCopyProperties", {
anchorX: this.catchWidth + this.changeMoveX * 2, // anchorX: this.catchWidth + this.changeMoveX * this.zoom,
anchorY: this.catchHeight + this.changeMoveY * 2 // anchorY: this.catchHeight + this.changeMoveY * this.zoom
}); // });
this.boxStyleCatch.anchorX=this.catchWidth + this.changeMoveX * this.zoom
this.boxStyleCatch.anchorY=this.catchHeight + this.changeMoveY * this.zoom
} else if (this.editEvent == "move") { } else if (this.editEvent == "move") {
this.$store.dispatch("modifyCopyProperties", { // this.$store.dispatch("modifyCopyProperties", {
y:this.catchY+this.changeMoveY * 2, // y:this.catchY+this.changeMoveY * this.zoom,
x:this.catchX+this.changeMoveX * 2 // x:this.catchX+this.changeMoveX * this.zoom
}); // });
this.boxStyleCatch.y=this.catchY+this.changeMoveY * this.zoom
this.boxStyleCatch.x=this.catchX+this.changeMoveX * this.zoom
} }
}, },
modifyPropertiesCon() { modifyPropertiesCon() {
if (this.editEvent == "bottomright") { if (this.editEvent == "bottomright") {
this.$store.dispatch("modifyProperties", { this.$store.dispatch("modifyProperties", {
width: this.catchWidth + this.changeMoveX * 2, width: parseInt(this.catchWidth + this.changeMoveX * this.zoom),
height: this.catchHeight + this.changeMoveY * 2 height: parseInt(this.catchHeight + this.changeMoveY * this.zoom)
}); });
}else if (this.editEvent == "top") { }else if (this.editEvent == "top") {
this.$store.dispatch("modifyProperties", { this.$store.dispatch("modifyProperties", {
height: this.catchHeight - this.changeMoveY * 2, height: parseInt(this.catchHeight - this.changeMoveY * this.zoom),
y:this.catchY+this.changeMoveY * 2 y:parseInt(this.catchY+this.changeMoveY * this.zoom)
}); });
} else if (this.editEvent == "right") { } else if (this.editEvent == "right") {
this.$store.dispatch("modifyProperties", { this.$store.dispatch("modifyProperties", {
width: this.catchWidth + this.changeMoveX * 2, width: parseInt(this.catchWidth + this.changeMoveX * this.zoom),
}); });
} else if (this.editEvent == "left") { } else if (this.editEvent == "left") {
this.$store.dispatch("modifyProperties", { this.$store.dispatch("modifyProperties", {
width: this.catchWidth - this.changeMoveX * 2, width: parseInt(this.catchWidth - this.changeMoveX * this.zoom),
x:this.catchX+this.changeMoveX * 2 x:parseInt(this.catchX+this.changeMoveX * this.zoom)
}); });
} else if (this.editEvent == "bottom") { } else if (this.editEvent == "bottom") {
this.$store.dispatch("modifyProperties", { this.$store.dispatch("modifyProperties", {
height: this.catchHeight + this.changeMoveY * 2, height: parseInt(this.catchHeight + this.changeMoveY * this.zoom),
}); });
} else if (this.editEvent == "topright") { } else if (this.editEvent == "topright") {
this.$store.dispatch("modifyProperties", { this.$store.dispatch("modifyProperties", {
width: this.catchWidth + this.changeMoveX * 2, width: parseInt(this.catchWidth + this.changeMoveX * this.zoom),
height: this.catchHeight - this.changeMoveY * 2, height: parseInt(this.catchHeight - this.changeMoveY * this.zoom),
y:this.catchY+this.changeMoveY * 2 y:parseInt(this.catchY+this.changeMoveY * this.zoom)
}); });
}else if (this.editEvent == "topleft") { }else if (this.editEvent == "topleft") {
this.$store.dispatch("modifyProperties", { this.$store.dispatch("modifyProperties", {
width: this.catchWidth - this.changeMoveX * 2, width: parseInt(this.catchWidth - this.changeMoveX * this.zoom),
height: this.catchHeight - this.changeMoveY * 2, height: parseInt(this.catchHeight - this.changeMoveY * this.zoom),
y:this.catchY+this.changeMoveY * 2, y:parseInt(this.catchY+this.changeMoveY * this.zoom),
x:this.catchX+this.changeMoveX * 2 x:parseInt(this.catchX+this.changeMoveX * this.zoom)
}); });
} else if (this.editEvent == "bottomleft") { } else if (this.editEvent == "bottomleft") {
this.$store.dispatch("modifyProperties", { this.$store.dispatch("modifyProperties", {
width: this.catchWidth - this.changeMoveX * 2, width: parseInt(this.catchWidth - this.changeMoveX * this.zoom),
height: this.catchHeight + this.changeMoveY * 2, height: parseInt(this.catchHeight + this.changeMoveY * this.zoom),
x:this.catchX+this.changeMoveX * 2 x:parseInt(this.catchX+this.changeMoveX * this.zoom)
}); });
} else if (this.editEvent == "center") { } else if (this.editEvent == "center") {
this.$store.dispatch("modifyProperties", { this.$store.dispatch("modifyProperties", {
anchorX: this.catchWidth + this.changeMoveX * 2, anchorX: parseInt(this.catchWidth + this.changeMoveX * this.zoom),
anchorY: this.catchHeight + this.changeMoveY * 2 anchorY: parseInt(this.catchHeight + this.changeMoveY * this.zoom)
}); });
} else if (this.editEvent == "move") { } else if (this.editEvent == "move") {
this.$store.dispatch("modifyProperties", { this.$store.dispatch("modifyProperties", {
y:this.catchY+this.changeMoveY * 2, y:parseInt(this.catchY+this.changeMoveY * this.zoom),
x:this.catchX+this.changeMoveX * 2 x:parseInt(this.catchX+this.changeMoveX * this.zoom)
}); });
} }
}, },
...@@ -248,36 +290,67 @@ export default { ...@@ -248,36 +290,67 @@ export default {
events.$on("setMoveEdit", data => { events.$on("setMoveEdit", data => {
this.moveEdit(data.e, data.type); this.moveEdit(data.e, data.type);
}); });
events.$on("setPlaygroundZoom", data => {
// this.moveEdit(data.e, data.type);
console.log("data.zoom",data.zoom)
this.zoom=1/data.zoom;
});
// events.$emit('setPlaygroundZoom', {zoom:this.zoom});
document.body.addEventListener("mouseup",(e)=>{ document.body.addEventListener("mouseup",(e)=>{
this.moveEdit(e,`mouseup`) this.moveEdit(e,`mouseup`)
}) })
document.body.addEventListener("mousemove",(e)=>{ document.body.addEventListener("mousemove",(e)=>{
this.moveEdit(e,`mousemove`) this.moveEdit(e,`mousemove`)
}) })
this.styleCatch=this.activeComponent.properties;
this.boxStyleCatch=this.activeComponent.properties;
}, },
computed: { computed: {
position() { position() {
let result = {}; let result = {};
result.x = this.activeComponent.properties.x; result.x = this.styleCatch.x;
result.y = this.activeComponent.properties.y; result.y = this.styleCatch.y;
return result; return result;
}, },
styleEdit() { styleEdit() {
if (!this.activeComponent) { if (!this.activeComponent) {
return {}; return {};
} }
console.log(this.activeComponent.properties); console.log( this.styleCatch);
let result={ let result={
width: `${this.activeComponent.properties.width}px`, width: `${ this.styleCatch.width}px`,
height: `${this.activeComponent.properties.height}px`, height: `${ this.styleCatch.height}px`,
marginTop: `${this.activeComponent.properties.y}px`, marginTop: `${ this.styleCatch.y}px`,
marginLeft: `${this.activeComponent.properties.x}px`, marginLeft: `${ this.styleCatch.x}px`,
transform: `rotate(${this.activeComponent.properties.rotation?this.activeComponent.properties.rotation:0}deg) transform: `rotate(${ this.styleCatch.rotation? this.styleCatch.rotation:0}deg)
scaleX(${this.activeComponent.properties.scaleX?this.activeComponent.properties.scaleX:1}) scaleX(${ this.styleCatch.scaleX? this.styleCatch.scaleX:1})
scaleY(${this.activeComponent.properties.scaleY?this.activeComponent.properties.scaleY:1})`, scaleY(${ this.styleCatch.scaleY? this.styleCatch.scaleY:1})`,
webkitTransformOriginY: `${this.activeComponent.properties.anchorY}px`, webkitTransformOriginY: `${ this.styleCatch.anchorY}px`,
webkitTransformOriginX: `${this.activeComponent.properties.anchorX}px`, webkitTransformOriginX: `${ this.styleCatch.anchorX}px`,
}
return result
},
boxstyleEdit(){
if (!this.activeComponent) {
return {};
}
console.log( this.boxStyleCatch);
let result={
width: `${ this.boxStyleCatch.width}px`,
height: `${ this.boxStyleCatch.height}px`,
marginTop: `${ this.boxStyleCatch.y}px`,
marginLeft: `${ this.boxStyleCatch.x}px`,
transform: `rotate(${ this.boxStyleCatch.rotation? this.boxStyleCatch.rotation:0}deg)
scaleX(${ this.boxStyleCatch.scaleX? this.boxStyleCatch.scaleX:1})
scaleY(${ this.boxStyleCatch.scaleY? this.boxStyleCatch.scaleY:1})`,
webkitTransformOriginY: `${ this.boxStyleCatch.anchorY}px`,
webkitTransformOriginX: `${ this.boxStyleCatch.anchorX}px`,
} }
return result return result
...@@ -290,20 +363,20 @@ export default { ...@@ -290,20 +363,20 @@ export default {
top: 0, top: 0,
left: 0 left: 0
}; };
if (this.activeComponent.properties.anchorX) { if ( this.styleCatch.anchorX) {
result.left = `${(this.activeComponent.properties.anchorX / result.left = `${( this.styleCatch.anchorX /
this.activeComponent.properties.width) * this.styleCatch.width) *
100}%`; 100}%`;
} else { } else {
this.activeComponent.properties.anchorX = 0; this.styleCatch.anchorX = 0;
} }
if (this.activeComponent.properties.anchorY) { if ( this.styleCatch.anchorY) {
result.top = `${(this.activeComponent.properties.anchorY / result.top = `${( this.styleCatch.anchorY /
this.activeComponent.properties.height) * this.styleCatch.height) *
100}%`; 100}%`;
} else { } else {
this.activeComponent.properties.anchorY = 0; this.styleCatch.anchorY = 0;
} }
return result; return result;
} }
...@@ -329,6 +402,12 @@ export default { ...@@ -329,6 +402,12 @@ export default {
height: 100%; height: 100%;
user-select: none; user-select: none;
} }
.edit-box-con-body{
box-sizing: border-box;
cursor: move;
border: 3px solid #ccc;
position: absolute;
}
.edit-con-body { .edit-con-body {
box-sizing: border-box; box-sizing: border-box;
cursor: move; cursor: move;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment