You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add brush behavior binary operators kAndThen, kOrElse, and kXorElse
These three operators allow for greater control over how to handle null values (e.g. unavailable source data) in brush behaviors:
* `kOrElse` returns the first non-null input, allowing for fallback branches in a brush behavior. If a subtree based on some source (like stylus tilt) is unavailable, the behavior can fall back to a substitute implementation.
* `kAndThen` returns the second input, but only if the first input is non-null. This can help when two separate behaviors are meant to work together, but one relies on a source that might be unavailable; `kAndThen` can be used in the other behavior to ensure that it also gets disabled when that source is unavailable.
* `kXorElse` is more niche, but can be used to combine two subtrees where only one should normally be defined at a time, and there's no defined way to combine them if both are defined. It can also be used with a constant node to form a sort of "logical not" for null values.
PiperOrigin-RevId: 875239647
0 commit comments