mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 23:47:45 +00:00
LibWeb: Fix coordinate translation for PaintTextShadow command
Fixes regression introduced in 4318bcf447
`shadow_bounding_rect` is used on bitmap allocated for shadow and is
not supposed to be in coordinate system of stacking context. Same for
`text_rect`.
Fixes https://github.com/SerenityOS/serenity/issues/21587
This commit is contained in:
parent
58f8068853
commit
437442719d
2 changed files with 3 additions and 6 deletions
|
@ -293,9 +293,6 @@ CommandResult PaintInnerBoxShadow::execute(CommandExecutionState& state) const
|
|||
|
||||
CommandResult PaintTextShadow::execute(CommandExecutionState& state) const
|
||||
{
|
||||
if (state.would_be_fully_clipped_by_painter(text_rect))
|
||||
return CommandResult::Continue;
|
||||
|
||||
// FIXME: Figure out the maximum bitmap size for all shadows and then allocate it once and reuse it?
|
||||
auto maybe_shadow_bitmap = Gfx::Bitmap::create(Gfx::BitmapFormat::BGRA8888, shadow_bounding_rect.size());
|
||||
if (maybe_shadow_bitmap.is_error()) {
|
||||
|
@ -758,8 +755,8 @@ void RecordingPainter::paint_text_shadow(int blur_radius, Gfx::IntRect bounding_
|
|||
{
|
||||
push_command(PaintTextShadow {
|
||||
.blur_radius = blur_radius,
|
||||
.shadow_bounding_rect = state().translation.map(bounding_rect),
|
||||
.text_rect = state().translation.map(text_rect),
|
||||
.shadow_bounding_rect = bounding_rect,
|
||||
.text_rect = text_rect,
|
||||
.text = String::from_utf8(text.as_string()).release_value_but_fixme_should_propagate_errors(),
|
||||
.font = font,
|
||||
.color = color,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue