Skip to content

Commit

Permalink
Prevent negative layout size
Browse files Browse the repository at this point in the history
Customer exposed a Yoga crash that occurs under a specific scenario
1. Artboard contains at least 1 layout that has a margin value set to use % (the actual value of the margin does not appear to matter).
2. Artboard subsequently gets sized to a negative width or height value

This causes an editor crash (quits immediately) with the error:
`availableWidth is indefinite so widthMeasureMode must be YGMeasureModeUndefined`

The proposed fix for this is to prevent negative width/height values from getting passed down to Yoga. This should not affect existing behavior because currently when negative values are passed down, Yoga does not return bounds values less than 0.

Simplified file attached.
[MarginCrash.rev.zip](https://github.com/user-attachments/files/18101320/MarginCrash.rev.zip)

Diffs=
ab29c640cc Prevent negative layout size (#8731)
  • Loading branch information
philter committed Dec 11, 2024
1 parent 81e3105 commit a2917d8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .rive_head
Original file line number Diff line number Diff line change
@@ -1 +1 @@
f9355c5d844b041f7ea6475ef99be7288f74404c
ab29c640ccc707dc5482446519ee3e8723fbf039
2 changes: 1 addition & 1 deletion submodules/rive-runtime

0 comments on commit a2917d8

Please sign in to comment.