Fix arrow anchor shift behavior
This commit is contained in:
@@ -172,13 +172,13 @@ export class Connections {
|
||||
const parentRect = transformRef?.instance.contentComponent?.getBoundingClientRect();
|
||||
const transformScale = transformRef?.instance.transformState.scale ?? 1;
|
||||
|
||||
const sourceVerticalCenter = (sourceRect.top - parentRect!.top) / transformScale + sourceRect.height / 2;
|
||||
const sourceHorizontalCenter = (sourceRect.left - parentRect!.left) / transformScale + sourceRect.width / 2;
|
||||
const sourceVerticalCenter = (sourceRect.top - parentRect!.top + sourceRect.height / 2) / transformScale;
|
||||
const sourceHorizontalCenter = (sourceRect.left - parentRect!.left + sourceRect.width / 2) / transformScale;
|
||||
|
||||
// Convert from DOM coords to connection coords
|
||||
// TODO: Break this out into util function and add tests
|
||||
const sourceX = (connectionLineX1 - sourceHorizontalCenter) / (sourceRect.width / 2);
|
||||
const sourceY = (sourceVerticalCenter - connectionLineY1) / (sourceRect.height / 2);
|
||||
const sourceX = (connectionLineX1 - sourceHorizontalCenter) / (sourceRect.width / 2 / transformScale);
|
||||
const sourceY = (sourceVerticalCenter - connectionLineY1) / (sourceRect.height / 2 / transformScale);
|
||||
|
||||
let targetX;
|
||||
let targetY;
|
||||
|
||||
Reference in New Issue
Block a user