Merge remote-tracking branch 'origin/master'

main
liu.shiyi 1 year ago
commit fa73decb72

@ -51,8 +51,10 @@ export default {
}), }),
getSelectionBoxStyle () { getSelectionBoxStyle () {
// 线 // 线
const left = Math.min(this.startX, this.endX) + 'px' let left = Math.min(this.startX, this.endX) + 'px'
const top = Math.min(this.startY, this.endY) + 'px' let top = Math.min(this.startY, this.endY) + 'px'
const left1 = Math.min(this.startX, this.endX) + 50 * this.scale + 'px'
const top1 = Math.min(this.startY, this.endY) + 50 * this.scale + 'px'
const width = Math.abs(this.endX - this.startX) + 'px' const width = Math.abs(this.endX - this.startX) + 'px'
const height = Math.abs(this.endY - this.startY) + 'px' const height = Math.abs(this.endY - this.startY) + 'px'
if (!this.isSelecting) { if (!this.isSelecting) {
@ -79,6 +81,7 @@ export default {
] ]
), ),
handleMouseDown (event) { handleMouseDown (event) {
//
if (event.button === 0) { if (event.button === 0) {
time = new Date() time = new Date()
// shift + // shift +
@ -86,11 +89,22 @@ export default {
return return
} }
this.isSelectDown = true this.isSelectDown = true
//
this.startX = (event.x - this.offsetX) / this.scale + 50 if (event.target.className.indexOf('mouse-select-wrap') !== -1) {
this.startY = (event.y - this.offsetY) / this.scale + 50 this.startX = event.offsetX
this.endX = (event.x - this.offsetX) / this.scale + 50 this.endX = event.offsetX
this.endY = (event.y - this.offsetY) / this.scale + 50 this.startY = event.offsetY
this.endY = event.offsetY
} else if (event.target.className.indexOf('design-drag-wrap') !== -1) {
this.startX = event.offsetX + 50
this.endX = event.offsetX + 50
this.startY = event.offsetY + 50
this.endY = event.offsetY + 50
}
// this.startX = (event.x - this.offsetX + 50) / this.scale
// this.startY = (event.y - this.offsetY + 50) / this.scale
// this.endX = (event.x - this.offsetX + 50) / this.scale
// this.endY = (event.y - this.offsetY + 50) / this.scale
} }
}, },
handleMouseMove (event) { handleMouseMove (event) {
@ -102,8 +116,13 @@ export default {
this.isSelecting = true this.isSelecting = true
} }
if (this.isSelecting) { if (this.isSelecting) {
this.endX = (event.x - this.offsetX) / this.scale + 50 if (event.target.className.indexOf('mouse-select-wrap') !== -1) {
this.endY = (event.y - this.offsetY) / this.scale + 50 this.endX = event.offsetX
this.endY = event.offsetY
} else if (event.target.className.indexOf('design-drag-wrap') !== -1) {
this.startX = event.offsetX + 50
this.endY = event.offsetY + 50
}
} }
}, },
handleMouseUp (event) { handleMouseUp (event) {

@ -214,6 +214,10 @@ export default {
scrollLeft = screenElement.scrollLeft scrollLeft = screenElement.scrollLeft
scrollTop = screenElement.scrollTop scrollTop = screenElement.scrollTop
maxContainer.addEventListener('mousemove', function (event) { maxContainer.addEventListener('mousemove', function (event) {
//
if (event.buttons !== 1) {
that.isDrag = false
}
if (that.isDrag) { if (that.isDrag) {
event.preventDefault() event.preventDefault()
// //
@ -427,52 +431,11 @@ export default {
.screen-container { .screen-container {
position: absolute; position: absolute;
overflow:hidden;
width: 6000px; width: 6000px;
height: 6000px; height: 6000px;
} }
.minimap{
position: fixed;
bottom: 15px;
right: 15px;
border: 1px solid #f6f7fb;
z-index:10000;
/*cursor: move;*/
}
.minimap .mapHeader{
background-color:#303640;
padding: 0 10px;
display: flex;
justify-content: space-between;
height: 20px;
width: 150px;
font-size: 12px;
border-bottom: 1px solid #fff;
color: #ffffff;
cursor: pointer;
span {
user-select: none;
}
}
.minimap .selectWin{
background-color: #232832;
height: 150px;
width: 150px;
position: relative;
}
.minimap .selectionWin{
position: absolute;
left: 0px;
top: 0px;
width: 30px;
height: 30px;
background-color: white;
opacity: 0.5;
cursor: move;
}
.scale-value { .scale-value {
position: absolute; position: absolute;
left: 0; left: 0;

@ -55,7 +55,6 @@
class="selectionWin" class="selectionWin"
/> />
</div> </div>
<div class="miniView" />
</div> </div>
<SketchDesignRuler <SketchDesignRuler
ref="Rules" ref="Rules"

Loading…
Cancel
Save