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 e5cbb51 commit 8e579e6
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 @@
9942df6a1dd563f388199860930f19a7ca31d299
ab29c640ccc707dc5482446519ee3e8723fbf039
2 changes: 1 addition & 1 deletion wasm/submodules/rive-runtime

0 comments on commit 8e579e6

Please sign in to comment.