Skip to content

Move visibility check to allow_rasterization #12040

Closed
@anntzer

Description

@anntzer

Currently, most implementations of draw() start with a check on get_visible() to immediately return if the artist is not visible. Most implementations of draw() are also decorated with allow_rasterization to, well, allow rasterization.

An exception to the former is QuiverKey; modifying e.g. the quiver_simple_key demo shows that QuiverKey does not respect the visibility flag.

While this could be fixed in place, I'd suggest instead to move the visibility check to the top of allow_rasterization, which will allow removing it from all actual implementations (of course, if there are artists that really don't want to be rasterizable (if there are any?), then they will need their own visibility check, and converserly if they don't want to obey the visibility flag (but I'd think most cases are just bugs)).

... in which case it may be worth renaming allow_rasterization to e.g. draw_wrapper or check_visibility_and_allow_rasterization (depending on the extent to which we want the name to state the functionality). Or we can just add another check_visibility decorator, but I guess it's a bit performant to have just one wrapper instead of two (no numbers to confirm that statement).

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: inactiveMarked by the “Stale” Github Action

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions