Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions x-pack/plugins/canvas/public/lib/aeroelastic/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -661,10 +661,18 @@ const alignmentGuides = (shapes, guidedShapes, draggedShape) => {
if (d.type === 'annotation') continue; // fixme avoid this by not letting annotations get in here
// key points of the dragged shape bounding box
for (let j = 0; j < shapes.length; j++) {
const s = shapes[j];
if (d.id === s.id) continue; // don't self-constrain; todo in the future, self-constrain to the original location
if (s.type === 'annotation') continue; // fixme avoid this by not letting annotations get in here
if (s.parent) continue; // for now, don't snap to grouped elements fixme could snap, but make sure transform is gloabl
const referenceShape = shapes[j];
if (referenceShape.type === 'annotation') continue; // fixme avoid this by not letting annotations get in here
if (referenceShape.parent) continue; // for now, don't snap to grouped elements fixme could snap, but make sure transform is gloabl
const s =
d.id === referenceShape.id
? {
...d,
localTransformMatrix: d.baselineLocalTransformMatrix || d.localTransformMatrix,
a: d.baseAB ? d.baseAB[0] : d.a,
b: d.baseAB ? d.baseAB[1] : d.b,
}
: referenceShape;
// key points of the stationery shape
for (let k = -1; k < 2; k++) {
for (let l = -1; l < 2; l++) {
Expand Down