diff options
author | MacDue <macdue@dueutil.tech> | 2023-04-01 21:13:18 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2023-04-01 22:39:47 +0100 |
commit | 14f937b29294231bba17189e35f7fa5e93d5dd52 (patch) | |
tree | 1768db3f6bfe885e619fd1ee2a9a229959401ed1 | |
parent | 7061a3d8e6ef3f32b9da5e6b65a331f6ff2e54a3 (diff) | |
download | serenity-14f937b29294231bba17189e35f7fa5e93d5dd52.zip |
LibWeb: Use scaled font when painting text shadows
This fixes painting text shadows at non-100% zoom.
-rw-r--r-- | Userland/Libraries/LibWeb/Painting/ShadowPainting.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWeb/Painting/ShadowPainting.cpp b/Userland/Libraries/LibWeb/Painting/ShadowPainting.cpp index 08061b37db..a4e2eaae9f 100644 --- a/Userland/Libraries/LibWeb/Painting/ShadowPainting.cpp +++ b/Userland/Libraries/LibWeb/Painting/ShadowPainting.cpp @@ -11,6 +11,7 @@ #include <LibGfx/Filters/StackBlurFilter.h> #include <LibGfx/Painter.h> #include <LibWeb/Layout/LineBoxFragment.h> +#include <LibWeb/Layout/Node.h> #include <LibWeb/Painting/BorderPainting.h> #include <LibWeb/Painting/BorderRadiusCornerClipper.h> #include <LibWeb/Painting/PaintContext.h> @@ -369,10 +370,9 @@ void paint_text_shadow(PaintContext& context, Layout::LineBoxFragment const& fra auto shadow_bitmap = maybe_shadow_bitmap.release_value(); Gfx::Painter shadow_painter { *shadow_bitmap }; - shadow_painter.set_font(context.painter().font()); // FIXME: "Spread" the shadow somehow. DevicePixelPoint baseline_start(text_rect.x(), text_rect.y() + context.rounded_device_pixels(fragment.baseline())); - shadow_painter.draw_text_run(baseline_start.to_type<int>(), Utf8View(fragment.text()), context.painter().font(), layer.color); + shadow_painter.draw_text_run(baseline_start.to_type<int>(), Utf8View(fragment.text()), fragment.layout_node().scaled_font(context), layer.color); // Blur Gfx::StackBlurFilter filter(*shadow_bitmap); |