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 <philterdesign@gmail.com>
This commit is contained in:
philter
2024-08-07 18:41:38 +00:00
parent 05e454f70e
commit de596cb916
3 changed files with 9 additions and 1 deletions

View File

@ -1 +1 @@
1b6afc1e96b6cac3a708b78381ce6fa7d0dd8058
0dc0b435ffb0df61de0afcdc2cea0c69bb8fedd4

View File

@ -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);

View File

@ -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;