Pictures in a placeholder show the layout placeholder's fill (#2072)

A slide picture with an empty p:spPr in a layout picture placeholder
that sets a fill drew only its pixels: the picture path drew a fill
only when the picture set its own, so the beige frame the layout gives
the placeholder never showed behind a transparent image. A picture
that sets neither a fill nor a style now draws the explicit fill its
layout or master placeholder sets, in the placeholder's geometry. Its
own fill (a:noFill included) and its own style decide as before, and a
style fill alone, inherited or not, stays undrawn.

Fixes #2068
This commit is contained in:
Hamza Naveed
2026-11-12 07:00:59 +00:00
committed by GitHub
parent 6eebec7df6
commit 6849fa0149
2 changed files with 63 additions and 2 deletions
+9 -2
View File
@@ -784,8 +784,15 @@ impl Renderer {
match &s.kind {
ShapeKind::Picture { fill: pf } => {
// The picture's own fill shows behind its transparent pixels, as in PowerPoint (an
// emphasis tint recolours it, as it does any shape's fill).
if s.fill.as_ref().is_some_and(|f| !f.is_none())
// emphasis tint recolours it, as it does any shape's fill). A picture that sets
// neither a fill nor a style shows the fill its layout or master placeholder sets
// (#2068). A style fill alone, its own or inherited, stays undrawn.
let explicit = |sh: &deckcraft_model::Shape| sh.fill.as_ref().is_some_and(|f| !f.is_none());
let inherited = || {
let (lp, mp) = resolve::parents(rctx, s);
[lp, mp].into_iter().flatten().find(|p| p.fill.is_some() || p.style.is_some()).is_some_and(explicit)
};
if (explicit(s) || (s.fill.is_none() && s.style.is_none() && inherited()))
&& let Some(fl) = &fill
{
self.fill_geometry(ctx, f, rctx, fl, fill_ph, geo, (w, h), m, pt_xy, &fade);