Repository navigation
Conversation
storytold#2324) An audio clip with its own picture (every audio shape a .pptx stores has one) was drawn with DeckCraft's speaker glyph over that picture, so imported audio showed two icons. As for video, the clip's picture is now all that shows; the built-in speaker or film glyph is drawn only when the clip has no picture. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Audio opened from a .pptx shows its own icon once, without DeckCraft's speaker drawn on top.
Fixes #2324.
What the user saw. In the editor, an audio clip from a .pptx showed two icons: the clip's own picture, stored with the audio in the file, and DeckCraft's blue speaker over it.
Cause. In the
ShapeKind::Mediaarm ofcrates/render/src/renderer.rs, the clip's picture (MediaClip::poster) is drawn when it has one. Thenif !mc.video || mc.poster.is_none()drew the speaker glyph for every audio clip, picture or not. PPTX import reads an audio shape's picture intoposter, so every imported audio clip with a picture got both.paint::media_glyph's own doc already says the glyph is for clips "without a poster".Change. The glyph (and a video's dark backing) is drawn only in the no-picture branch. A clip with its own picture shows just that picture, as video already did; a clip without one still shows the speaker or film glyph. Only drawing changes. Setting or resetting an audio clip's picture from the app is #2209, which builds on this.
Test.
tests::an_audio_clips_own_picture_is_drawn_without_the_speaker_glyphgives an audio clip a picture as large as its box, a green PNG generated in the test, and checks that every sampled pixel inside the box is that green. It also checks that a clip without a picture still draws the speaker. Fails onmain(454 sampled points off-green: the speaker), passes with the fix. A picture only a few pixels across did not show the bug, because the glyph then lands outside the box, so the test uses a full-size one.Verification (local, Linux):
cargo fmt --all --check: pass.cargo clippy -p deckcraft-render --all-targets -- -D warnings: pass.cargo test -p deckcraft-render: 224 passed, 1 failed. The failure istests::east_asian_vertical_text_stands_ideographs_upright, which fails the same way onmainhere: no CJK font, because../craft-fontsis not checked out.cargo xtask wasm: pass.cargo xtask ci.🤖 Generated with Claude Code
Summary by CodeRabbit