Skip to content

fix: respect the visibility property on shapes - #499

Merged
deeplook merged 1 commit into
deeplook:mainfrom
Sanjays2402:fix/respect-visibility-hidden
Jul 31, 2026
Merged

fix: respect the visibility property on shapes#499
deeplook merged 1 commit into
deeplook:mainfrom
Sanjays2402:fix/respect-visibility-hidden

Conversation

@Sanjays2402

Copy link
Copy Markdown
Contributor

Closes #359

renderNode only consulted display, so a shape with visibility="hidden" was still rendered. The value is now resolved with findAttr, which reads the style attribute and walks ancestors, so inheritance from a group and a visibility="visible" override on a child both behave correctly; collapse is treated as hidden too.

Regression test added in tests/test_basic.py next to the display:none test — it fails without the one-line change and passes with it.

This change was prepared with AI assistance; the regression test was run locally and fails without the fix.

Shapes carrying visibility="hidden" (or "collapse"), either directly or
inherited from an ancestor, were still rendered. renderNode only checked
the display property. The visibility value is now resolved with
findAttr, which walks the style attribute and ancestors, so inheritance
and a visible override on a child both work.

Adds a regression test covering the presentation attribute, the style
form, inheritance from a group and a visible child override.

Closes deeplook#359
@deeplook

Copy link
Copy Markdown
Owner

Thanks for the fix and the thorough regression test — merging.

@deeplook
deeplook merged commit 7ae1599 into deeplook:main Jul 31, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

visibility ignored using svg2rlg and renderPM.drawToFile

2 participants