Skip to content

Commit

Permalink
Add NestedArtboardLayout hug
Browse files Browse the repository at this point in the history
Add hug overrides for nested artboards.

There is one caveat. Since the Artboard is a special type of layout where children can exist in regular transform space OR inside a layout, in order for nested artboard hug to work, the nested artboard must be in AutoLayout mode (ie has at least 1 relative layout child) and when you set hug on the nested artboard (inside the parent artboard) it will hug to whatever the size of the layout children are. It will not currently hug to components in the Artboard that exist in regular transform space.

https://github.com/user-attachments/assets/eee4568e-c5d3-4987-b852-a52cbd2af563

Diffs=
95cad5c60 Add NestedArtboardLayout hug (#8137)
edc91a599 Initial refactor to simplfigy class structure (#8122)
e9918f249 d3d11 simplifications (#8134)
84f332761 Optimize draw to avoid creating when clip is empty (#8128)
c67b67083 Updates to layout hug (#8132)
30f5778b1 revisit sync between flutter and c++ runtime (#8101)
eb4c9d36b Fix intrinsically sizeable bug (#8131)
bc6010b6e bump premake (#8120)
06f13b3d8 Fix default target id for ListenerAlignTarget (#8110)
a4e15fb7b Add fallback font support for iOS and macOS (#7690)
24bb958f1 Fix dstreadshuffle gm (#8100)

Co-authored-by: Philip Chung <philterdesign@gmail.com>
  • Loading branch information
philter and philter committed Sep 14, 2024
1 parent 93c1280 commit 11f0c50
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .rive_head
Original file line number Diff line number Diff line change
@@ -1 +1 @@
a84aea792f208119fbea5c0fe0704c9d484aaa2c
95cad5c6055750ff6b1c033f903967e6b9c22bb6
2 changes: 2 additions & 0 deletions lib/src/rive_core/nested_artboard.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ abstract class MountedArtboard {
double get originalArtboardHeight;
void artboardWidthOverride(double width, int widthUnitValue, bool isRow);
void artboardHeightOverride(double height, int heightUnitValue, bool isRow);
void artboardWidthIntrinsicallySizeOverride(bool intrinsic);
void artboardHeightIntrinsicallySizeOverride(bool intrinsic);
void dispose();
void dataContextFromInstance(ViewModelInstance viewModelInstance,
DataContext? dataContextValue, bool isRoot);
Expand Down
6 changes: 6 additions & 0 deletions lib/src/runtime_mounted_artboard.dart
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ class RuntimeMountedArtboard extends MountedArtboard {
@override
void artboardHeightOverride(double height, int heightUnitValue, bool isRow) {}

@override
void artboardWidthIntrinsicallySizeOverride(bool intrinsic) {}

@override
void artboardHeightIntrinsicallySizeOverride(bool intrinsic) {}

@override
double get originalArtboardWidth => originalArtboardInstanceSize.width;

Expand Down

0 comments on commit 11f0c50

Please sign in to comment.