File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change 3
3
:style =" {
4
4
width: `${width + dw}px`,
5
5
height: `${(width + dw) / ratio}px`,
6
- transform: `translate(${x + dx}px, ${y + dy}px)` ,
6
+ transform: translateCoordinates() ,
7
7
}" >
8
8
<div class ="
9
9
absolute
@@ -58,6 +58,8 @@ export default {
58
58
' x' ,
59
59
' y' ,
60
60
' pageScale' ,
61
+ ' pageWidth' ,
62
+ ' pageHeight' ,
61
63
' path' ,
62
64
],
63
65
data () {
@@ -133,15 +135,15 @@ export default {
133
135
134
136
if (this .operation === ' move' ) {
135
137
this .$emit (' onUpdate' , {
136
- x: this . x + this . dx ,
137
- y: this . y + this . dy ,
138
+ x: coordinate . detail . x ,
139
+ y: coordinate . detail . y ,
138
140
})
139
141
this .dx = 0
140
142
this .dy = 0
141
143
} else if (this .operation === ' scale' ) {
142
144
this .$emit (' onUpdate' , {
143
- x: this . x + this . dx ,
144
- y: this . y + this . dy ,
145
+ x: coordinate . detail . x ,
146
+ y: coordinate . detail . y ,
145
147
width: this .width + this .dw ,
146
148
scale: (this .width + this .dw ) / this .originWidth ,
147
149
})
Original file line number Diff line number Diff line change 170
170
:x =" object.x"
171
171
:y =" object.y"
172
172
:width =" object.width"
173
+ :height =" object.height"
173
174
:origin-width =" object.originWidth"
174
175
:origin-height =" object.originHeight"
175
176
:page-scale =" pagesScale[pIndex]"
177
+ :page-width =" pageSizes[pIndex + 1].width"
178
+ :page-height =" pageSizes[pIndex + 1].height"
176
179
@onUpdate =" updateObject(object.id, $event)"
177
180
@onDelete =" deleteObject(object.id)" />
178
181
</div >
@@ -620,6 +623,7 @@ export default {
620
623
originWidth,
621
624
originHeight,
622
625
width: originWidth * scale,
626
+ height: originHeight * scale,
623
627
scale,
624
628
}
625
629
this .addObject (object)
You can’t perform that action at this time.
0 commit comments