Skip to content

Commit 72af780

Browse files
committed
List fill, stroke, opacity, width and height as node property variables
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YaHo5D7kD3eWcagvzh3o3K
1 parent 736737a commit 72af780

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## Unreleased
2+
3+
- Every node with fills, strokes or opacity now lists `fill`, `stroke` and
4+
`opacity` in its property variables, and every node lists `width` and
5+
`height`, so conditions, bound variables and set value actions can change
6+
them at runtime.
7+
18
## 5.2.0
29

310
### New actions

‎lib/src/api/mixins.dart‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,9 +1044,21 @@ mixin VariablePropertiesMixin {
10441044
mixin PropertyVariableMixin on BaseNode {
10451045
/// Properties of the node that can be used in actions or can be changed by
10461046
/// an action.
1047+
///
1048+
/// Style properties (fill, stroke, opacity, width, height) can be set by
1049+
/// conditions, bound to variables or formulas, or changed by a set value
1050+
/// action, on any node that has them.
10471051
late final List<ValueModel> propertyVariables = [
10481052
BoolValue(name: 'visible', value: visible),
10491053
IntValue(name: 'rotationDegrees', value: rotationDegrees),
1054+
if (this case final GeometryMixin geometry) ...[
1055+
PaintValue(name: 'fill', value: geometry.fills.firstOrNull),
1056+
PaintValue(name: 'stroke', value: geometry.strokes.firstOrNull),
1057+
],
1058+
if (this case final BlendMixin blend)
1059+
DoubleValue(name: 'opacity', value: blend.opacity),
1060+
DoubleValue(name: 'width', value: basicBoxLocal.width),
1061+
DoubleValue(name: 'height', value: basicBoxLocal.height),
10501062
];
10511063
}
10521064

0 commit comments

Comments
 (0)