summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/Painting/LabelablePaintable.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-03-10 22:46:35 +0100
committerAndreas Kling <kling@serenityos.org>2022-03-11 00:21:49 +0100
commitcb0c5390ff9a0189ae79cfd690f6c089ba73c4a7 (patch)
treef6b3f94c65f92cb195e67eb75add5eb9815e8cc2 /Userland/Libraries/LibWeb/Painting/LabelablePaintable.cpp
parented84fbce474a86721ff85aa9559213e12bd556ba (diff)
downloadserenity-cb0c5390ff9a0189ae79cfd690f6c089ba73c4a7.zip
LibWeb: Move mouse event and label logic from layout to painting tree
Input events have nothing to do with layout, so let's not send them to layout nodes. The job of Paintable starts to become clear. It represents a paintable item that can be rendered into the viewport, which means it can also be targeted by the mouse cursor.
Diffstat (limited to 'Userland/Libraries/LibWeb/Painting/LabelablePaintable.cpp')
-rw-r--r--Userland/Libraries/LibWeb/Painting/LabelablePaintable.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/Painting/LabelablePaintable.cpp b/Userland/Libraries/LibWeb/Painting/LabelablePaintable.cpp
new file mode 100644
index 0000000000..4c0b0527f6
--- /dev/null
+++ b/Userland/Libraries/LibWeb/Painting/LabelablePaintable.cpp
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+#include <LibWeb/Painting/LabelablePaintable.h>
+
+namespace Web::Painting {
+
+Layout::LabelableNode const& LabelablePaintable::layout_box() const
+{
+ return static_cast<Layout::LabelableNode const&>(PaintableBox::layout_box());
+}
+
+Layout::LabelableNode& LabelablePaintable::layout_box()
+{
+ return static_cast<Layout::LabelableNode&>(PaintableBox::layout_box());
+}
+
+LabelablePaintable::LabelablePaintable(Layout::LabelableNode const& layout_node)
+ : PaintableBox(layout_node)
+{
+}
+
+}