From de596cb916478ffe10b83a84125fdf779df6fdab Mon Sep 17 00:00:00 2001 From: philter Date: Wed, 7 Aug 2024 18:41:38 +0000 Subject: [PATCH] Add width/height overrides for NestedArtboardLayout Adds the ability to override width and height for NestedArtboardLayout. This allows each NestedArtboardLayout instance to respond to be sized differently. This is not supported in the NestedArtboard Node and Leaf types, since those are resized using differently (Node uses scale and Leaf uses a combination of scale/fit/alignment). Implemented via FFI as discussed with @luigi-rosso because NestedArtboardLayout modifying the "taken" layoutNode directly could result in race conditions and other conflicts. https://github.com/user-attachments/assets/c323a94f-f392-4c10-ac01-af112f70a256 Diffs= 0dc0b435f Add width/height overrides for NestedArtboardLayout (#7736) 1131f30e6 refactor conditions (#7747) 35a52873c Fix layout shape hug in CPP (#7770) 949c70600 Add a premake message when Xcode command line tools isn't installed (#7756) 4bf7c7545 add data converter and data types for conversion (#7734) Co-authored-by: Philip Chung --- .rive_head | 2 +- lib/src/rive_core/nested_artboard.dart | 2 ++ lib/src/runtime_mounted_artboard.dart | 6 ++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.rive_head b/.rive_head index ebdacc7..eb57b2c 100644 --- a/.rive_head +++ b/.rive_head @@ -1 +1 @@ -1b6afc1e96b6cac3a708b78381ce6fa7d0dd8058 +0dc0b435ffb0df61de0afcdc2cea0c69bb8fedd4 diff --git a/lib/src/rive_core/nested_artboard.dart b/lib/src/rive_core/nested_artboard.dart index d5268c3..a8bc488 100644 --- a/lib/src/rive_core/nested_artboard.dart +++ b/lib/src/rive_core/nested_artboard.dart @@ -58,6 +58,8 @@ abstract class MountedArtboard { double get artboardHeight; double get originalArtboardWidth; double get originalArtboardHeight; + void artboardWidthOverride(double width, int widthUnitValue, bool isRow); + void artboardHeightOverride(double height, int heightUnitValue, bool isRow); void dispose(); void dataContextFromInstance(ViewModelInstance viewModelInstance, DataContext? dataContextValue, bool isRoot); diff --git a/lib/src/runtime_mounted_artboard.dart b/lib/src/runtime_mounted_artboard.dart index c0aa297..6069bac 100644 --- a/lib/src/runtime_mounted_artboard.dart +++ b/lib/src/runtime_mounted_artboard.dart @@ -87,6 +87,12 @@ class RuntimeMountedArtboard extends MountedArtboard { artboardInstance.height = height; } + @override + void artboardWidthOverride(double width, int widthUnitValue, bool isRow) {} + + @override + void artboardHeightOverride(double height, int heightUnitValue, bool isRow) {} + @override double get originalArtboardWidth => originalArtboardInstanceSize.width;