Pārlūkot izejas kodu

LibWeb: Stop scrolling above content in BlockBox

davidot 4 gadi atpakaļ
vecāks
revīzija
9fd9ce1f9e
1 mainītis faili ar 2 papildinājumiem un 1 dzēšanām
  1. 2 1
      Userland/Libraries/LibWeb/Layout/BlockBox.cpp

+ 2 - 1
Userland/Libraries/LibWeb/Layout/BlockBox.cpp

@@ -150,7 +150,8 @@ bool BlockBox::is_scrollable() const
 
 void BlockBox::set_scroll_offset(const Gfx::FloatPoint& offset)
 {
-    if (m_scroll_offset == offset)
+    // FIXME: If there is horizontal and vertical scroll ignore only part of the new offset
+    if (offset.y() < 0 || m_scroll_offset == offset)
         return;
     m_scroll_offset = offset;
     set_needs_display();