mirror of
https://github.com/penpot/penpot.git
synced 2026-08-01 19:06:18 +00:00
🐛 Fix blur affecting extra shapes
This commit is contained in:
parent
585a2d7523
commit
9fa027c1df
File diff suppressed because it is too large
Load Diff
@ -455,4 +455,24 @@ test("Check inner stroke artifacts", async ({
|
|||||||
maxDiffPixelRatio: 0,
|
maxDiffPixelRatio: 0,
|
||||||
threshold: 0.1,
|
threshold: 0.1,
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
test("BUG 13551 - Blurs affecting other elements", async ({
|
||||||
|
page,
|
||||||
|
}) => {
|
||||||
|
const workspace = new WasmWorkspacePage(page);
|
||||||
|
await workspace.setupEmptyFile();
|
||||||
|
await workspace.mockGetFile("render-wasm/get-file-blurs-affecting-other-elements.json");
|
||||||
|
|
||||||
|
await workspace.goToWorkspace({
|
||||||
|
id: "effcbebc-b8c8-802f-8007-a7dc677169cd",
|
||||||
|
pageId: "a5508528-5928-8008-8007-a7de9feef61bd",
|
||||||
|
});
|
||||||
|
await workspace.waitForFirstRenderWithoutUI();
|
||||||
|
|
||||||
|
// Stricter comparison: blur is very subtle
|
||||||
|
await expect(workspace.canvas).toHaveScreenshot({
|
||||||
|
maxDiffPixelRatio: 0,
|
||||||
|
threshold: 0.1,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
@ -53,6 +53,8 @@ pub struct NodeRenderState {
|
|||||||
visited_mask: bool,
|
visited_mask: bool,
|
||||||
// This bool indicates that we're drawing the mask shape.
|
// This bool indicates that we're drawing the mask shape.
|
||||||
mask: bool,
|
mask: bool,
|
||||||
|
// True when this container was flattened (enter/exit skipped).
|
||||||
|
flattened: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get simplified children of a container, flattening nested flattened containers
|
/// Get simplified children of a container, flattening nested flattened containers
|
||||||
@ -1462,6 +1464,7 @@ impl RenderState {
|
|||||||
clip_bounds: None,
|
clip_bounds: None,
|
||||||
visited_mask: true,
|
visited_mask: true,
|
||||||
mask: false,
|
mask: false,
|
||||||
|
flattened: false,
|
||||||
});
|
});
|
||||||
if let Some(&mask_id) = element.mask_id() {
|
if let Some(&mask_id) = element.mask_id() {
|
||||||
self.pending_nodes.push(NodeRenderState {
|
self.pending_nodes.push(NodeRenderState {
|
||||||
@ -1470,6 +1473,7 @@ impl RenderState {
|
|||||||
clip_bounds: None,
|
clip_bounds: None,
|
||||||
visited_mask: false,
|
visited_mask: false,
|
||||||
mask: true,
|
mask: true,
|
||||||
|
flattened: false,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1999,8 +2003,7 @@ impl RenderState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if visited_children {
|
if visited_children {
|
||||||
// Skip render_shape_exit for flattened containers
|
if !node_render_state.flattened {
|
||||||
if !element.can_flatten() {
|
|
||||||
self.render_shape_exit(element, visited_mask, clip_bounds);
|
self.render_shape_exit(element, visited_mask, clip_bounds);
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
@ -2149,6 +2152,7 @@ impl RenderState {
|
|||||||
clip_bounds: clip_bounds.clone(),
|
clip_bounds: clip_bounds.clone(),
|
||||||
visited_mask: false,
|
visited_mask: false,
|
||||||
mask,
|
mask,
|
||||||
|
flattened: can_flatten,
|
||||||
});
|
});
|
||||||
|
|
||||||
if element.is_recursive() {
|
if element.is_recursive() {
|
||||||
@ -2195,6 +2199,7 @@ impl RenderState {
|
|||||||
clip_bounds: children_clip_bounds.clone(),
|
clip_bounds: children_clip_bounds.clone(),
|
||||||
visited_mask: false,
|
visited_mask: false,
|
||||||
mask: false,
|
mask: false,
|
||||||
|
flattened: false,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2309,6 +2314,7 @@ impl RenderState {
|
|||||||
clip_bounds: None,
|
clip_bounds: None,
|
||||||
visited_mask: false,
|
visited_mask: false,
|
||||||
mask: false,
|
mask: false,
|
||||||
|
flattened: false,
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user