diff --git a/Userland/Libraries/LibWeb/Painting/Command.h b/Userland/Libraries/LibWeb/Painting/Command.h index c064c59f7c9..776dddb96e8 100644 --- a/Userland/Libraries/LibWeb/Painting/Command.h +++ b/Userland/Libraries/LibWeb/Painting/Command.h @@ -145,7 +145,6 @@ struct PaintTextShadow { NonnullRefPtr glyph_run; double glyph_run_scale { 1 }; Color color; - int fragment_baseline; Gfx::IntPoint draw_location; [[nodiscard]] Gfx::IntRect bounding_rect() const { return { draw_location, shadow_bounding_rect.size() }; } diff --git a/Userland/Libraries/LibWeb/Painting/DisplayListPlayerCPU.cpp b/Userland/Libraries/LibWeb/Painting/DisplayListPlayerCPU.cpp index 9723d10ec2d..d33cbb70106 100644 --- a/Userland/Libraries/LibWeb/Painting/DisplayListPlayerCPU.cpp +++ b/Userland/Libraries/LibWeb/Painting/DisplayListPlayerCPU.cpp @@ -270,7 +270,7 @@ CommandResult DisplayListPlayerCPU::paint_text_shadow(PaintTextShadow const& com Gfx::Painter shadow_painter { *shadow_bitmap }; // FIXME: "Spread" the shadow somehow. - Gfx::IntPoint const baseline_start(command.text_rect.x(), command.text_rect.y() + command.fragment_baseline); + Gfx::IntPoint const baseline_start(command.text_rect.x(), command.text_rect.y()); shadow_painter.translate(baseline_start); auto const& glyphs = command.glyph_run->glyphs(); for (auto const& glyph_or_emoji : glyphs) { diff --git a/Userland/Libraries/LibWeb/Painting/DisplayListPlayerGPU.cpp b/Userland/Libraries/LibWeb/Painting/DisplayListPlayerGPU.cpp index f762929d4b7..5948daf9e9e 100644 --- a/Userland/Libraries/LibWeb/Painting/DisplayListPlayerGPU.cpp +++ b/Userland/Libraries/LibWeb/Painting/DisplayListPlayerGPU.cpp @@ -190,7 +190,7 @@ CommandResult DisplayListPlayerGPU::paint_text_shadow(PaintTextShadow const& com text_shadow_painter->clear(command.color.with_alpha(0)); Gfx::FloatRect const shadow_location { command.draw_location, command.shadow_bounding_rect.size() }; - Gfx::IntPoint const baseline_start(command.text_rect.x(), command.text_rect.y() + command.fragment_baseline); + Gfx::IntPoint const baseline_start(command.text_rect.x(), command.text_rect.y()); text_shadow_painter->translate(baseline_start.to_type()); text_shadow_painter->draw_glyph_run(command.glyph_run->glyphs(), command.color); if (command.blur_radius == 0) { diff --git a/Userland/Libraries/LibWeb/Painting/DisplayListRecorder.cpp b/Userland/Libraries/LibWeb/Painting/DisplayListRecorder.cpp index ccea46be000..79843b8b8e5 100644 --- a/Userland/Libraries/LibWeb/Painting/DisplayListRecorder.cpp +++ b/Userland/Libraries/LibWeb/Painting/DisplayListRecorder.cpp @@ -344,7 +344,7 @@ void DisplayListRecorder::paint_inner_box_shadow_params(PaintBoxShadowParams par append(PaintInnerBoxShadow { .box_shadow_params = params }); } -void DisplayListRecorder::paint_text_shadow(int blur_radius, Gfx::IntRect bounding_rect, Gfx::IntRect text_rect, Gfx::GlyphRun const& glyph_run, double glyph_run_scale, Color color, int fragment_baseline, Gfx::IntPoint draw_location) +void DisplayListRecorder::paint_text_shadow(int blur_radius, Gfx::IntRect bounding_rect, Gfx::IntRect text_rect, Gfx::GlyphRun const& glyph_run, double glyph_run_scale, Color color, Gfx::IntPoint draw_location) { append(PaintTextShadow { .blur_radius = blur_radius, @@ -353,7 +353,6 @@ void DisplayListRecorder::paint_text_shadow(int blur_radius, Gfx::IntRect boundi .glyph_run = glyph_run, .glyph_run_scale = glyph_run_scale, .color = color, - .fragment_baseline = fragment_baseline, .draw_location = state().translation.map(draw_location) }); } diff --git a/Userland/Libraries/LibWeb/Painting/DisplayListRecorder.h b/Userland/Libraries/LibWeb/Painting/DisplayListRecorder.h index e0dbf7d4ea1..10162eba41e 100644 --- a/Userland/Libraries/LibWeb/Painting/DisplayListRecorder.h +++ b/Userland/Libraries/LibWeb/Painting/DisplayListRecorder.h @@ -127,7 +127,7 @@ public: void paint_outer_box_shadow_params(PaintBoxShadowParams params); void paint_inner_box_shadow_params(PaintBoxShadowParams params); - void paint_text_shadow(int blur_radius, Gfx::IntRect bounding_rect, Gfx::IntRect text_rect, Gfx::GlyphRun const&, double glyph_run_scale, Color color, int fragment_baseline, Gfx::IntPoint draw_location); + void paint_text_shadow(int blur_radius, Gfx::IntRect bounding_rect, Gfx::IntRect text_rect, Gfx::GlyphRun const&, double glyph_run_scale, Color color, Gfx::IntPoint draw_location); void fill_rect_with_rounded_corners(Gfx::IntRect const& rect, Color color, Gfx::AntiAliasingPainter::CornerRadius top_left_radius, Gfx::AntiAliasingPainter::CornerRadius top_right_radius, Gfx::AntiAliasingPainter::CornerRadius bottom_right_radius, Gfx::AntiAliasingPainter::CornerRadius bottom_left_radius, Vector const& clip_paths = {}); void fill_rect_with_rounded_corners(Gfx::IntRect const& a_rect, Color color, int radius, Vector const& clip_paths = {}); diff --git a/Userland/Libraries/LibWeb/Painting/ShadowPainting.cpp b/Userland/Libraries/LibWeb/Painting/ShadowPainting.cpp index c2c8290d162..67a25be25b1 100644 --- a/Userland/Libraries/LibWeb/Painting/ShadowPainting.cpp +++ b/Userland/Libraries/LibWeb/Painting/ShadowPainting.cpp @@ -610,7 +610,7 @@ void paint_text_shadow(PaintContext& context, PaintableFragment const& fragment, draw_rect.y() + offset_y - margin }; - context.display_list_recorder().paint_text_shadow(blur_radius, bounding_rect, text_rect, fragment.glyph_run(), context.device_pixels_per_css_pixel(), layer.color, fragment_baseline, draw_location); + context.display_list_recorder().paint_text_shadow(blur_radius, bounding_rect, text_rect.translated(0, fragment_baseline), fragment.glyph_run(), context.device_pixels_per_css_pixel(), layer.color, draw_location); } }