Skip to content

Commit

Permalink
ObjectGrid: fixed crash
Browse files Browse the repository at this point in the history
  • Loading branch information
timothyschoen committed Dec 27, 2023
1 parent 57dde15 commit 3553101
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Source/ObjectGrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,13 @@ Point<int> ObjectGrid::performResize(Object* toDrag, Point<int> dragOffset, Rect
auto isDraggingLeft = resizeZone.isDraggingLeftEdge();
auto isDraggingRight = resizeZone.isDraggingRightEdge();

// Not great that we need to do this, but otherwise we don't really know the object bounds for sure
toDrag->getConstrainer()->checkBounds(newResizeBounds, toDrag->originalBounds, limits,
isDraggingTop, isDraggingLeft, isDraggingBottom, isDraggingRight);
if(auto* constrainer = toDrag->getConstrainer())
{
// Not great that we need to do this, but otherwise we don't really know the object bounds for sure
constrainer->checkBounds(newResizeBounds, toDrag->originalBounds, limits,
isDraggingTop, isDraggingLeft, isDraggingBottom, isDraggingRight);
}


// Returns non-zero if the object has a fixed ratio
auto ratio = toDrag->getConstrainer()->getFixedAspectRatio();
Expand Down

0 comments on commit 3553101

Please sign in to comment.