|
@@ -24,11 +24,15 @@
|
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
*/
|
|
|
|
|
|
-#include <LibGfx/Font.h>
|
|
|
-#include <LibGfx/StylePainter.h>
|
|
|
#include <LibGUI/Painter.h>
|
|
|
+#include <LibGUI/ScrollBar.h>
|
|
|
#include <LibGUI/Widget.h>
|
|
|
+#include <LibGfx/Font.h>
|
|
|
+#include <LibGfx/StylePainter.h>
|
|
|
+#include <LibWeb/DOM/Document.h>
|
|
|
+#include <LibWeb/Frame.h>
|
|
|
#include <LibWeb/Layout/LayoutWidget.h>
|
|
|
+#include <LibWeb/PageView.h>
|
|
|
|
|
|
namespace Web {
|
|
|
|
|
@@ -47,7 +51,11 @@ void LayoutWidget::layout(LayoutMode layout_mode)
|
|
|
{
|
|
|
rect().set_size(widget().width(), widget().height());
|
|
|
LayoutReplaced::layout(layout_mode);
|
|
|
- widget().move_to(rect().x(), rect().y());
|
|
|
+
|
|
|
+ auto adjusted_widget_position = rect().location().to_int_point();
|
|
|
+ if (auto* page_view = document().frame()->page_view())
|
|
|
+ adjusted_widget_position.move_by(-page_view->horizontal_scrollbar().value(), -page_view->vertical_scrollbar().value());
|
|
|
+ widget().move_to(adjusted_widget_position);
|
|
|
}
|
|
|
|
|
|
void LayoutWidget::render(RenderingContext& context)
|