Layout Editor UX Updates

Layout UX stuff @alxgibsn and I have been working on.

- Layout Padding Inspector (padding)
- Layout Children Inspector (flex direction, gap)
- New points/percent toggle
- Right click component > Wrap in Layout
- Fix text incorrect sizing issue when using intrinsic sizing
- Groups as layout children don't resize to parent layout
- Layout cells in hierarchy
- Add compensate logic when dropping components into layouts
- Bug fixes related to selecting and transforming components and their parent layouts together

<img width="1138" alt="Screenshot 2024-05-13 at 1 31 04 PM" src="https://github.com/rive-app/rive/assets/186340/5df89f3d-44dc-4155-b9e0-09f31b2ea7af">

Diffs=
e89250c39 Layout Editor UX Updates (#7260)
5ccc21fa3 fix advancing nested animations (#7246)
8700c7365 remove harfbuzz flag (#7233)
e0c4d9a20 Don't defer path update if Shape has a dependent skin (#7231)
806ae1fae Fix an assert in contour_measure.cpp (#7232)
7d03c3faf Add strokes, gradients, and blend modes to path_fuzz (#7230)
4342a3f04 Wasm fallback and min safari version (#7214)

Co-authored-by: Alex Gibson <agibson.uk@gmail.com>
Co-authored-by: Philip Chung <philterdesign@gmail.com>
This commit is contained in:
philter
2024-05-15 17:41:37 +00:00
parent 1107b4c093
commit 62148fc963
4 changed files with 14 additions and 6 deletions

View File

@ -1 +1 @@
4c23759b665fa82a96d62c7c9fd9c7b5d59bc8e1
e89250c3979e7fc78137eda9545c49d7436d1fa6

View File

@ -235,7 +235,9 @@ class LayoutComponentStyle extends LayoutComponentStyleBase {
void onAddedDirty() {}
@override
void layoutFlags0Changed(int from, int to) => markLayoutNodeDirty();
void layoutFlags0Changed(int from, int to) {
markLayoutNodeDirty();
}
@override
void layoutFlags1Changed(int from, int to) {
@ -243,7 +245,9 @@ class LayoutComponentStyle extends LayoutComponentStyleBase {
}
@override
void layoutFlags2Changed(int from, int to) => markLayoutNodeDirty();
void layoutFlags2Changed(int from, int to) {
markLayoutNodeDirty();
}
@override
void flexChanged(double from, double to) => markLayoutNodeDirty();

View File

@ -7,6 +7,7 @@ import 'package:rive/src/rive_core/bounds_provider.dart';
import 'package:rive/src/rive_core/component_dirt.dart';
import 'package:rive/src/rive_core/container_component.dart';
import 'package:rive/src/rive_core/layout/layout_component_style.dart';
import 'package:rive/src/rive_core/node.dart';
import 'package:rive/src/rive_core/world_transform_component.dart';
import 'package:rive_common/layout_engine.dart';
import 'package:rive_common/math.dart';
@ -241,10 +242,11 @@ class LayoutComponent extends LayoutComponentBase {
style = context.resolve(styleId);
}
void createLayoutStyle() {
LayoutComponentStyle createLayoutStyle() {
var newStyle = LayoutComponentStyle();
context.addObject(newStyle);
style = newStyle;
return newStyle;
}
void setupStyle(LayoutComponentStyle style) {
@ -291,7 +293,9 @@ class LayoutComponent extends LayoutComponentBase {
return;
}
forEachChild((child) {
if (child is LayoutComponent) {
// Don't propagate down to children of nested layout components
// or groups
if (child is LayoutComponent || child.coreType == NodeBase.typeKey) {
return false;
}
if (child is Sizable) {

View File

@ -325,7 +325,7 @@ class Text extends TextBase with TextStyleContainer implements Sizable {
break;
}
lines.dispose();
return Size(bounds.width, bounds.height);
return Size(bounds.width.ceilToDouble(), bounds.height.ceilToDouble());
}
void _buildRenderStyles() {