mirror of
https://github.com/penpot/penpot.git
synced 2025-07-19 01:18:41 +02:00
🐛 Fix inner strokes black background effect
This commit is contained in:
parent
88e77e3218
commit
5c58a04fc2
2 changed files with 26 additions and 10 deletions
|
@ -8,13 +8,19 @@ pub fn render(
|
|||
surface_id: Option<SurfaceId>,
|
||||
paint: Option<skia::Paint>,
|
||||
) {
|
||||
let use_save_layer = paint.is_some();
|
||||
let mask_paint = paint.unwrap_or_default();
|
||||
let mask = SaveLayerRec::default().paint(&mask_paint);
|
||||
let canvas = render_state
|
||||
.surfaces
|
||||
.canvas(surface_id.unwrap_or(SurfaceId::Fills));
|
||||
|
||||
canvas.save_layer(&mask);
|
||||
// Skip save_layer when no custom paint is provided to avoid isolating content unnecessarily.
|
||||
// This ensures inner strokes and fills can blend correctly on the same surface.
|
||||
if use_save_layer {
|
||||
canvas.save_layer(&mask);
|
||||
}
|
||||
|
||||
for group in paragraphs {
|
||||
let mut offset_y = 0.0;
|
||||
for skia_paragraph in group {
|
||||
|
@ -23,5 +29,7 @@ pub fn render(
|
|||
offset_y += skia_paragraph.height();
|
||||
}
|
||||
}
|
||||
canvas.restore();
|
||||
if use_save_layer {
|
||||
canvas.restore();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue