Is Within Layer node doesn't work as expected when iterating

Steps causing the bug to occur

Don’t know if this is a bug, or the intent, but it’s certainly making things non-intuitive…

  1. Process a list of iterators
  2. Use “Is Point within Layer”, or “Is Within Rectangle” in conjunction with “Get Rendered Layer Bounds”
  3. Seems to calculate the point as being within each layer if it happens to be only within the first one in the list

See attached composition, or this video. Mouse over the text.

The background layer is red with “Get Layer Bounds” and “Is within Rectangle” is true.
The background layer is green with “Get Rendered Layer Bounds” and “Is within Rectangle” is true.
The background layer is blue with “Is Point within Layer” is true.

Red works on all three layers. Green and blue are there to show the bug.

Have you found a workaround?

Using “Get Layer Bounds” and “Is within Rectangle” does the trick.

Other notes

  • Vuo version: 2.3.2
  • macOS version: macOS 11
  • CPU: arm64

isWithin.vuo (10.1 KB)

@Pianomatic,

The problem is that all 3 text layers have the same ID since they’re created by a single node in a Build List loop, so the Is Point Within Layer node isn’t able to distinguish between them.

As you found, instead of using Is Point within Layer, use Is within Rectangle and calculate the rectangle to check. You could also create individual Make Text Layer nodes (rather than iterate inside a loop).

We are planning for a new way to iterate that will assign a unique ID to every layer inside the iterator, but we don’t yet have a timeline on when that’ll be available.

2 Likes