Skip to content

Commit a5c3f59

Browse files
susan101566blakdragan7
authored andcommitted
editor+runtime: expose Shape length via databinding
It might be useful for follow path to line break on the size of the shape instead of on the original size of the text box. This can be done through data-binding. This PR exposes a 'length' property on Shapes that's derived from the shape's paths and cannot be set. The method is quite similar to how worldBounds on a shape is calculated -- lazily. When we invalidate the bound, we invalidate the length property. The UI in the editor is this text box. Note that this property won't update as you change the bounds of the shape because the property is calculated lazily. I'm inclined to just show a '-' when the value is invalid, but that's up for discussion. On the runtime side, it's pretty similar. <img width="341" alt="image" src="https://github.com/user-attachments/assets/0a08ec74-3ce6-4bfa-97f6-aecfa97e53a1" /> Tests: 1. I added an editor test that accesses length from shape. This may seem vacuous, but mainly I just wanted to test that there's no infinite recursion problems. 2. I'd like to add a golden test for this, but it seems our testing harness doesn't support detecting a view model yet. I manually tested in the runtime viewer app that this shows up fine: <img width="1520" alt="image" src="https://github.com/user-attachments/assets/800bb79c-a138-4788-bfa9-b7377b3462ec" /> 3. I loaded up wasm locally and it seems to work fine. Diffs= 28f17bd861 editor+runtime: expose Shape length via databinding (#9160)
1 parent 15ce3f6 commit a5c3f59

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

.rive_head

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
fa9791bbdabfa1565a22b0d19f0e3b07d22a1fb1
1+
28f17bd8613ed244296506413d3028d3046edcf6

0 commit comments

Comments
 (0)