|
|
@@ -30,6 +30,7 @@ export default {
|
|
|
scale: 100,
|
|
|
minScale: 100,
|
|
|
maxScale: 100,
|
|
|
+ padding: 0,
|
|
|
selectedWidgetIndex: -1,
|
|
|
node: null,
|
|
|
bgm: '',
|
|
|
@@ -149,8 +150,8 @@ export default {
|
|
|
checkRatio () {
|
|
|
const wrapper = this.$refs.wrapper
|
|
|
if (wrapper && this.node) {
|
|
|
- const width = wrapper.offsetWidth
|
|
|
- const height = wrapper.offsetHeight
|
|
|
+ const width = wrapper.offsetWidth - this.padding * 2
|
|
|
+ const height = wrapper.offsetHeight - this.padding * 2
|
|
|
const { width: cWidth, height: cHeight } = this.node
|
|
|
const wScale = width / cWidth
|
|
|
const hScale = height / cHeight
|
|
|
@@ -286,7 +287,7 @@ export default {
|
|
|
},
|
|
|
snap () {
|
|
|
this.snapping = true
|
|
|
- return domToImage.toJpeg(this.$refs.wrapper, {
|
|
|
+ return domToImage.toJpeg(this.$refs.canvas, {
|
|
|
filter (node) {
|
|
|
const { tagName } = node
|
|
|
if (tagName === 'CANVAS') {
|