|
@@ -112,8 +112,8 @@ export default {
|
|
|
return {
|
|
|
rulerWidth: 0,
|
|
|
rulerHeight: 0,
|
|
|
- startX: -20,
|
|
|
- startY: -25,
|
|
|
+ startX: -10,
|
|
|
+ startY: -15,
|
|
|
lines: {
|
|
|
h: [],
|
|
|
v: []
|
|
@@ -162,7 +162,8 @@ export default {
|
|
|
showRuler: (state) => state.showRuler,
|
|
|
}),
|
|
|
scale() {
|
|
|
- return new Big(this.realScale).div(new Big(5)).toNumber()
|
|
|
+ // return new Big(this.realScale).div(new Big(5)).toNumber()
|
|
|
+ return new Big(this.realScale).toNumber();
|
|
|
},
|
|
|
shadow() {
|
|
|
return {
|
|
@@ -174,8 +175,10 @@ export default {
|
|
|
},
|
|
|
canvasStyle() {
|
|
|
return {
|
|
|
- width: `${this.rectWidth * 5}px`,
|
|
|
- height: `${this.rectHeight * 5}px`,
|
|
|
+ // width: `${this.rectWidth * 5}px`,
|
|
|
+ // height: `${this.rectHeight * 5}px`,
|
|
|
+ width: `${this.rectWidth}px`,
|
|
|
+ height: `${this.rectHeight}px`,
|
|
|
transform: `scale(${this.scale})`,
|
|
|
background: this.pageConfig?.background,
|
|
|
color: this.pageConfig?.color,
|
|
@@ -211,6 +214,8 @@ export default {
|
|
|
return elementBands.findLast(elementBand => elementBand.code === bandCode);
|
|
|
},
|
|
|
getElementBandFormStore(bandCode) {
|
|
|
+ console.log('bandCode >>', bandCode)
|
|
|
+ console.log('elementBand >>', ElementUtils.getElementBandFromStore(bandCode))
|
|
|
return ElementUtils.getElementBandFromStore(bandCode);
|
|
|
},
|
|
|
handleMouseDown(e) {
|
|
@@ -223,13 +228,18 @@ export default {
|
|
|
|
|
|
// 获取编辑器的位移信息,每次点击时都需要获取一次。主要是为了方便开发时调试用。
|
|
|
const rectInfo = this.editor.getBoundingClientRect()
|
|
|
+
|
|
|
+ console.log('reactInfo >>', rectInfo)
|
|
|
this.editorX = rectInfo.x
|
|
|
this.editorY = rectInfo.y
|
|
|
|
|
|
const startX = e.clientX
|
|
|
const startY = e.clientY
|
|
|
+
|
|
|
+ console.log('reactInfo >>', rectInfo)
|
|
|
this.start.x = (startX - this.editorX) / this.scale
|
|
|
this.start.y = (startY - this.editorY) / this.scale
|
|
|
+
|
|
|
// 展示选中区域
|
|
|
this.isShowArea = true
|
|
|
|
|
@@ -238,10 +248,12 @@ export default {
|
|
|
this.height = Math.abs((moveEvent.clientY - startY) / this.scale)
|
|
|
if (moveEvent.clientX < startX) {
|
|
|
this.start.x = (moveEvent.clientX - this.editorX) / this.scale
|
|
|
+ console.log('x >> ', this.start.x)
|
|
|
}
|
|
|
|
|
|
if (moveEvent.clientY < startY) {
|
|
|
this.start.y = (moveEvent.clientY - this.editorY) / this.scale
|
|
|
+ console.log('y >> ', this.start.y)
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -383,8 +395,10 @@ export default {
|
|
|
const screensRect = document.querySelector('#screens').getBoundingClientRect()
|
|
|
const canvasRect = document.querySelector('#designer-page').getBoundingClientRect()
|
|
|
// 标尺开始的刻度
|
|
|
- const startX = (screensRect.left + this.thick - canvasRect.left) / this.realScale
|
|
|
- const startY = (screensRect.top + this.thick - canvasRect.top) / this.realScale
|
|
|
+ // const startX = (screensRect.left + this.thick - canvasRect.left) / this.realScale
|
|
|
+ // const startY = (screensRect.top + this.thick - canvasRect.top) / this.realScale
|
|
|
+ const startX = (screensRect.left + this.thick - canvasRect.left)
|
|
|
+ const startY = (screensRect.top + this.thick - canvasRect.top)
|
|
|
|
|
|
this.startX = startX
|
|
|
this.startY = startY
|
|
@@ -482,8 +496,8 @@ export default {
|
|
|
|
|
|
.screen-container {
|
|
|
position: absolute;
|
|
|
- width: 5000px;
|
|
|
- height: 5000px;
|
|
|
+ width: 2000px;
|
|
|
+ height: 2000px;
|
|
|
}
|
|
|
|
|
|
.yvan-print-designer-main__page {
|