mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:37:45 +00:00
LibWeb: Don't clear clip rect history but restore previous state
This commit is contained in:
parent
9469531100
commit
958c79da64
1 changed files with 2 additions and 1 deletions
|
@ -60,6 +60,7 @@ void ButtonPaintable::paint(PaintContext& context, PaintPhase phase) const
|
||||||
|
|
||||||
// Paint button text clipped to button rect
|
// Paint button text clipped to button rect
|
||||||
auto& painter = context.painter();
|
auto& painter = context.painter();
|
||||||
|
painter.save();
|
||||||
painter.add_clip_rect(button_rect.to_type<int>());
|
painter.add_clip_rect(button_rect.to_type<int>());
|
||||||
painter.draw_text(
|
painter.draw_text(
|
||||||
text_rect.to_type<int>(),
|
text_rect.to_type<int>(),
|
||||||
|
@ -67,7 +68,7 @@ void ButtonPaintable::paint(PaintContext& context, PaintPhase phase) const
|
||||||
FontCache::the().scaled_font(layout_box().font(), context.device_pixels_per_css_pixel()),
|
FontCache::the().scaled_font(layout_box().font(), context.device_pixels_per_css_pixel()),
|
||||||
Gfx::TextAlignment::Center,
|
Gfx::TextAlignment::Center,
|
||||||
computed_values().color());
|
computed_values().color());
|
||||||
painter.clear_clip_rect();
|
painter.restore();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue