Explorar o código

LibWeb: Add Layout::Box::margin_box_width()

Andreas Kling %!s(int64=4) %!d(string=hai) anos
pai
achega
d18bc9ccd2
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      Userland/Libraries/LibWeb/Layout/Box.h

+ 6 - 0
Userland/Libraries/LibWeb/Layout/Box.h

@@ -52,6 +52,12 @@ public:
     float width() const { return m_size.width(); }
     float width() const { return m_size.width(); }
     float height() const { return m_size.height(); }
     float height() const { return m_size.height(); }
 
 
+    float margin_box_width() const
+    {
+        auto margin_box = box_model().margin_box();
+        return width() + margin_box.left + margin_box.right;
+    }
+
     float border_box_width() const
     float border_box_width() const
     {
     {
         auto border_box = box_model().border_box();
         auto border_box = box_model().border_box();