自适应水印缩放
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
<div
|
||||
class="watermark"
|
||||
v-if="currIndex > -1 && currWatermarkConfig.length"
|
||||
:style="{left: x + 'px', top: y + 'px' }"
|
||||
:style="{left: x + 'px', top: y + 'px', transform: 'scale(' + watermarkScale + ')' }"
|
||||
@touchstart="onTouchstart"
|
||||
@touchmove="onTouchmove">
|
||||
<component ref="WatermarkItem" :is="'Watermark' + (currIndex + 1)" :config="currWatermarkConfig"></component>
|
||||
@@ -155,6 +155,7 @@
|
||||
x: 32,
|
||||
y: 24,
|
||||
startX: 0,
|
||||
watermarkScale: 1,
|
||||
startY: 0,
|
||||
canvasHeight: 0
|
||||
}
|
||||
@@ -224,6 +225,7 @@
|
||||
const img = document.querySelector('.waterMarker-img')
|
||||
|
||||
this.canvasHeight = img.clientHeight
|
||||
this.watermarkScale = img.clientWidth / uni.getSystemInfoSync().windowWidth
|
||||
},
|
||||
|
||||
onTouchstart (e) {
|
||||
|
||||
Reference in New Issue
Block a user