Skip to content

Commit

Permalink
add viewmodel and data enum system core objects
Browse files Browse the repository at this point in the history
This PR only has the boilerplate code to support system data enums.
System enums will be enums that are built-in in Rive, like text alignment, word wrapping, blend modes.
Those system enums won't be included in the .riv file, but they'll exist built-in in the runtime.
This PR creates 4 new core objects types. 2 extends from data_enum and 2 from viewmodel_property_enum.
The rest of the changes are renaming the base class to the custom one.

Diffs=
5297cf0cc2 add viewmodel and data enum system core objects (#8382)
f53d2d9c91 editor: bug fixes for image n-slicing (#8424)
2c83c60225 Nnnn fix layout hittest order (#8435)
afcf0992da editor: vector n-slicer should clamp all shapes contained (#8428)
c7de07c0ca fix for image_diff not correctly outputting newline in status file (#8438)
ea59076bf7 Expose RenderContext methods for allocating tessellation vertices (#8408)
e71b4cc081 feat: add runtime layout fit type for ios, android, web (#8341)

Co-authored-by: hernan <hernan@rive.app>
  • Loading branch information
bodymovin and bodymovin committed Oct 30, 2024
1 parent bcb15a4 commit 5ae5403
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 24 deletions.
2 changes: 1 addition & 1 deletion .rive_head
Original file line number Diff line number Diff line change
@@ -1 +1 @@
960d8be2a1c60e5bfa26d0b4ea052c96809b86c5
5297cf0cc25ef5b45d438dddaefb2ac52cb8c4a1
23 changes: 0 additions & 23 deletions lib/src/rive_core/viewmodel/data_enum.dart
Original file line number Diff line number Diff line change
@@ -1,34 +1,11 @@
import 'package:rive/src/generated/viewmodel/data_enum_base.dart';
import 'package:rive/src/rive_core/container_component.dart';
import 'package:rive/src/rive_core/viewmodel/data_enum_value.dart';

export 'package:rive/src/generated/viewmodel/data_enum_base.dart';

class DataEnum extends DataEnumBase {
DataEnumValues children = DataEnumValues();
void addValue(DataEnumValue item) {
if (!children.contains(item)) {
children.add(item);
}
}

@override
void onAdded() {}

@override
void onAddedDirty() {}

@override
void onRemoved() {
children.toList().forEach((child) => child.remove());
super.onRemoved();
}

void removeValue(DataEnumValue item) {
children.remove(item);
}

void internalAddValue(DataEnumValue item) {
addValue(item);
}
}

0 comments on commit 5ae5403

Please sign in to comment.