Edit in GitHubLog an issue

Properties with object values

Some scenegraph properties have values that are not simple primitive types (e.g. numbers), but rather are objects with sub-properties of their own. In order to update the document with changes, you must invoke the top-level setter on the scenenode object itself – changing properties on the object value "inline" will not result in an update.

For example:

Copied to your clipboard
1// Right:
2let color = node.fill;
3color.r = 0x80;
4node.fill = color; // update fill in the scenegraph by kicking the node's setter
5
6// Wrong - document will not update:
7node.color.r = 0x80;
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2023 Adobe. All rights reserved.