LibWeb: Reset Painter when resetting canvas to its initial state

This commit is contained in:
Tim Ledbetter 2025-10-21 17:49:12 +01:00 committed by Jelle Raaijmakers
parent 017e8a5b8d
commit 1c00279488
Notes: github-actions[bot] 2025-10-23 16:53:42 +00:00
7 changed files with 119 additions and 1 deletions

View file

@ -634,8 +634,10 @@ void CanvasRenderingContext2D::reset_to_default_state()
// 4. Reset everything that drawing state consists of to their initial values.
reset_drawing_state();
if (surface)
if (surface) {
painter()->reset();
did_draw(surface->rect().to_type<float>());
}
}
// https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-measuretext