mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 21:16:00 +00:00
SYNC: fixed selecting in diagrams with zoom
This commit is contained in:
committed by
Diflow
parent
fde257c722
commit
7a5e17a345
@@ -632,9 +632,15 @@
|
||||
const domTable = domTables[x.designerId] as any;
|
||||
if (domTable) {
|
||||
const rect = domTable.getRect();
|
||||
const rectZoomed = {
|
||||
left: rect.left / zoomKoef,
|
||||
right: rect.right / zoomKoef,
|
||||
top: rect.top / zoomKoef,
|
||||
bottom: rect.bottom / zoomKoef,
|
||||
};
|
||||
return {
|
||||
...x,
|
||||
isSelectedTable: rectanglesHaveIntersection(rect, bounds),
|
||||
isSelectedTable: rectanglesHaveIntersection(rectZoomed, bounds),
|
||||
};
|
||||
}
|
||||
}),
|
||||
|
||||
@@ -11,11 +11,16 @@ export default function moveDrag(node, dragEvents) {
|
||||
const handleMoveDown = e => {
|
||||
if (e.button != 0) return;
|
||||
|
||||
const zoomKoef = window.getComputedStyle(node)['zoom'];
|
||||
// const zoomKoef = window.getComputedStyle(node)['zoom'];
|
||||
|
||||
const clientRect = node.getBoundingClientRect();
|
||||
clientX = clientRect.left * zoomKoef;
|
||||
clientY = clientRect.top * zoomKoef;
|
||||
clientX = clientRect.left;
|
||||
clientY = clientRect.top;
|
||||
|
||||
// console.log('ZOOM', zoomKoef);
|
||||
// console.log('CLIENT RECT', clientRect);
|
||||
// console.log('e.clientX', e.clientX);
|
||||
// console.log('e.clientY', e.clientY);
|
||||
|
||||
startX = e.clientX;
|
||||
startY = e.clientY;
|
||||
@@ -25,7 +30,7 @@ export default function moveDrag(node, dragEvents) {
|
||||
};
|
||||
|
||||
const handleMoveMove = e => {
|
||||
const zoomKoef = window.getComputedStyle(node)['zoom'];
|
||||
// const zoomKoef = window.getComputedStyle(node)['zoom'];
|
||||
|
||||
e.preventDefault();
|
||||
const diffX = e.clientX - startX;
|
||||
@@ -36,7 +41,7 @@ export default function moveDrag(node, dragEvents) {
|
||||
onMove(diffX, diffY, e.clientX - clientX, e.clientY - clientY);
|
||||
};
|
||||
const handleMoveEnd = e => {
|
||||
const zoomKoef = window.getComputedStyle(node)['zoom'];
|
||||
// const zoomKoef = window.getComputedStyle(node)['zoom'];
|
||||
|
||||
e.preventDefault();
|
||||
startX = null;
|
||||
|
||||
Reference in New Issue
Block a user