Skip to content

fix(textbox): apply lineOpacity to textbox borders - #669

Merged
ShotaroKataoka merged 3 commits into
mainfrom
crew/fix-textbox-line-opacity
Nov 30, 2026
Merged

ShotaroKataoka merged 3 commits into
mainfrom
crew/fix-textbox-line-opacity

Conversation

@ShotaroKataoka

Copy link
Copy Markdown
Contributor

🤖 KiroCrew automated comment: PR created by KiroCrew on behalf of the maintainers. It will not be merged by KiroCrew.

Summary

A textbox border ignored lineOpacity, so a translucent border came out fully opaque. Since #651, pptx_to_json reads lineOpacity from a textbox border, so a PPTX → JSON → PPTX round trip also lost it. The textbox builder now writes the border alpha with the same rule and helper as shapes.

Changes

File Change
sdpm/sdpm/engine/builder/elements/textbox.py Border branch calls the existing _set_line_opacity when 0 <= lineOpacity < 1 (same rule as shapes). No converter change.
tests/test_element_roundtrip.py TestTextboxBox.test_border_opacity_survives: lineOpacity: 0.5 writes <a:alpha val="50000"/> and comes back as 0.5; no lineOpacity or lineOpacity: 1 writes no alpha.
sdpm/references/guides/slide-json-elements.md One bullet: lineOpacity in the textbox section, next to line / lineWidth.
CHANGELOG.md [Unreleased] → Fixed entry.

Tests

  • New test fails without the fix (AttributeError: no a:alpha under the border colour) and passes with it.
  • uv run ruff check sdpm/sdpm/engine/builder/elements/textbox.py tests/test_element_roundtrip.py → All checks passed
  • uv run pytest -q tests/test_element_roundtrip.py → 121 passed
  • make all → ruff clean; 3637 passed, 22 skipped

Not run: ash scan.

Boundaries touched

  • sdpm/references/ (one bullet in slide-json-elements.md)

Closes #667

@ShotaroKataoka ShotaroKataoka added bug Something isn't working kirocrew Created by KiroCrew (automated) labels Nov 20, 2026
@ShotaroKataoka ShotaroKataoka added the blog:skip ブログ対象外 label Nov 30, 2026
@ShotaroKataoka
ShotaroKataoka enabled auto-merge (squash) November 30, 2026 06:39
@ShotaroKataoka
ShotaroKataoka merged commit 02f4bf3 into main Nov 30, 2026
28 of 29 checks passed
@ShotaroKataoka
ShotaroKataoka deleted the crew/fix-textbox-line-opacity branch November 30, 2026 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blog:skip ブログ対象外 bug Something isn't working kirocrew Created by KiroCrew (automated)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(textbox): border ignores lineOpacity, so it is lost on round trip

1 participant