File tree Expand file tree Collapse file tree 3 files changed +19
-12
lines changed Expand file tree Collapse file tree 3 files changed +19
-12
lines changed Original file line number Diff line number Diff line change @@ -138,6 +138,7 @@ import WIDGET_CONFIG_OPEN from '../graphql/widgetConfigOpen.gql'
138
138
import WIDGET_CONFIG_SAVE from ' ../graphql/widgetConfigSave.gql'
139
139
140
140
const GRID_SIZE = 200
141
+ const ZOOM = 0.7
141
142
142
143
const state = new Vue ({
143
144
data: {
@@ -169,12 +170,14 @@ export default {
169
170
170
171
Movable ({
171
172
field: ' widget' ,
172
- gridSize: GRID_SIZE
173
+ gridSize: GRID_SIZE ,
174
+ zoom: ZOOM
173
175
}),
174
176
175
177
Resizable ({
176
178
field: ' widget' ,
177
- gridSize: GRID_SIZE
179
+ gridSize: GRID_SIZE ,
180
+ zoom: ZOOM
178
181
})
179
182
],
180
183
@@ -353,6 +356,8 @@ export default {
353
356
<style lang="stylus" scoped>
354
357
@import "~@/style/imports"
355
358
359
+ $zoom = .7
360
+
356
361
.shell ,
357
362
.move-ghost ,
358
363
.resize-ghost
@@ -461,15 +466,15 @@ export default {
461
466
462
467
.customizing
463
468
.wrapper
464
- border-radius ($br / .7 )
469
+ border-radius ($br / $zoom )
465
470
466
471
.content-wrapper
467
472
opacity .5
468
473
filter blur(8px)
469
474
470
475
.customize-overlay
471
476
/deep/ > *
472
- transform scale (1 / .7 )
477
+ transform scale (1 / $zoom )
473
478
474
479
.resize-handle
475
480
position absolute
@@ -515,7 +520,7 @@ export default {
515
520
z-index 10000
516
521
.backdrop
517
522
background rgba ($vue-ui-color-accent, .2 )
518
- border-radius ($br / .7 )
523
+ border-radius ($br / $zoom )
519
524
.vue-ui-dark-mode &
520
525
background rgba (lighten($vue-ui-color-accent, 60% ), .2 )
521
526
@@ -551,6 +556,6 @@ export default {
551
556
& .v-enter ,
552
557
& .v-leave-to
553
558
.shell
554
- transform scale (.7 )
559
+ transform scale ($zoom )
555
560
opacity 0
556
561
</style >
Original file line number Diff line number Diff line change 1
1
export default function movable ( {
2
2
gridSize,
3
- field
3
+ field,
4
+ zoom
4
5
} ) {
5
6
// @vue /component
6
7
return {
@@ -23,8 +24,8 @@ export default function movable ({
23
24
updateMoveState ( e ) {
24
25
const mouseDeltaX = e . clientX - this . $_initalMousePosition . x
25
26
const mouseDeltaY = e . clientY - this . $_initalMousePosition . y
26
- const pxX = this [ field ] . x * gridSize + mouseDeltaX / 0.7
27
- const pxY = this [ field ] . y * gridSize + mouseDeltaY / 0.7
27
+ const pxX = this [ field ] . x * gridSize + mouseDeltaX / zoom
28
+ const pxY = this [ field ] . y * gridSize + mouseDeltaY / zoom
28
29
let x = Math . round ( pxX / gridSize )
29
30
let y = Math . round ( pxY / gridSize )
30
31
if ( x < 0 ) x = 0
Original file line number Diff line number Diff line change 1
1
export default function ( {
2
2
gridSize,
3
- field
3
+ field,
4
+ zoom
4
5
} ) {
5
6
// @vue /component
6
7
return {
@@ -47,8 +48,8 @@ export default function ({
47
48
} ,
48
49
49
50
updateResizeState ( e ) {
50
- const mouseDeltaX = ( e . clientX - this . $_initalMousePosition . x ) / 0.7
51
- const mouseDeltaY = ( e . clientY - this . $_initalMousePosition . y ) / 0.7
51
+ const mouseDeltaX = ( e . clientX - this . $_initalMousePosition . x ) / zoom
52
+ const mouseDeltaY = ( e . clientY - this . $_initalMousePosition . y ) / zoom
52
53
const handle = this . $_resizeHandle
53
54
let dX = 0
54
55
let dY = 0
You can’t perform that action at this time.
0 commit comments