Skip to content

Add element rotation/mirror transforms and coerce string visible - #23

Merged
g4bri3lDev merged 2 commits into
mainfrom
feat/visible-coercion-transforms
Jun 25, 2026
Merged

Add element rotation/mirror transforms and coerce string visible #23
g4bri3lDev merged 2 commits into
mainfrom
feat/visible-coercion-transforms

Conversation

@g4bri3lDev

Copy link
Copy Markdown
Member

No description provided.

@codecov

codecov Bot commented Jun 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

…e values

Add generic rotation and mirror as standard fields supported on every
element type, handled centrally so no element handler changes. Each
transformed element is rendered onto its own layer, then mirrored/rotated
about a pivot and composited back.

- rotation: degrees, positive = clockwise (arbitrary values)
- mirror: "h", "v", or "hv"
- pivot: bbox anchor keyword (e.g. "tl") or [x, y] canvas coords;
  defaults to the element's visual center

Distinct from the image-only `rotate` field (which rotates the source
image before fitting it to the box).

Also coerce string `visible` values so templated output works as expected:
"false" (case-insensitive) and empty/whitespace strings hide the element;
any other non-empty string shows it. Previously bool("false") was truthy,
so a template rendering "false" wrongly showed the element.

Docs and auto-generated rotation/mirror screenshots added.
@g4bri3lDev
g4bri3lDev force-pushed the feat/visible-coercion-transforms branch from ce9d9d3 to 92b16fd Compare June 25, 2026 11:28
Pivot anchor keywords now parse positionally like Pillow text anchors
(first char horizontal l/m/r, second vertical t/m/b), instead of an
order-independent scan that mis-resolved 'mt'/'mb' to the center.

Also unify the README anchor docs: text, icon, icon_sequence and pivot
share one anchor table. The separate icon table documented a vertical-first
scheme (tl/bl/br) that the Pillow-native icon handler no longer uses.
@g4bri3lDev
g4bri3lDev merged commit b5c4d47 into main Jun 25, 2026
6 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.

1 participant