mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:17:45 +00:00
LibWeb: Implement position:fixed painting at the stacking context level
This makes everything within the stacking context stick show up in the correct position.
This commit is contained in:
parent
7b0cd15495
commit
2447b27d97
2 changed files with 5 additions and 4 deletions
|
@ -24,10 +24,6 @@ void Box::paint(PaintContext& context, PaintPhase phase)
|
||||||
if (!is_visible())
|
if (!is_visible())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Gfx::PainterStateSaver saver(context.painter());
|
|
||||||
if (is_fixed_position())
|
|
||||||
context.painter().translate(context.scroll_offset());
|
|
||||||
|
|
||||||
if (phase == PaintPhase::Background) {
|
if (phase == PaintPhase::Background) {
|
||||||
paint_background(context);
|
paint_background(context);
|
||||||
paint_box_shadow(context);
|
paint_box_shadow(context);
|
||||||
|
|
|
@ -107,6 +107,11 @@ void StackingContext::paint_internal(PaintContext& context)
|
||||||
|
|
||||||
void StackingContext::paint(PaintContext& context)
|
void StackingContext::paint(PaintContext& context)
|
||||||
{
|
{
|
||||||
|
Gfx::PainterStateSaver saver(context.painter());
|
||||||
|
if (m_box.is_fixed_position()) {
|
||||||
|
context.painter().translate(context.scroll_offset());
|
||||||
|
}
|
||||||
|
|
||||||
auto opacity = m_box.computed_values().opacity();
|
auto opacity = m_box.computed_values().opacity();
|
||||||
if (opacity.has_value() && opacity.value() == 0.0f)
|
if (opacity.has_value() && opacity.value() == 0.0f)
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue