ladybird/Libraries/LibHTML/Layout/ComputedStyle.cpp
Sergey Bugaev 3be897a3d5 LibHTML: Add ComputedStyle::full_margin()
This is an utility to easily get the full margin size
(the sum of margin proper, border and padding) of an
element in pixels.
2019-09-28 18:29:42 +02:00

19 lines
525 B
C++

#include <LibHTML/Layout/ComputedStyle.h>
ComputedStyle::ComputedStyle()
{
}
ComputedStyle::~ComputedStyle()
{
}
ComputedStyle::PixelBox ComputedStyle::full_margin() const
{
return {
m_margin.top.to_px() + m_border.top.to_px() + m_padding.top.to_px(),
m_margin.right.to_px() + m_border.right.to_px() + m_padding.right.to_px(),
m_margin.bottom.to_px() + m_border.bottom.to_px() + m_padding.bottom.to_px(),
m_margin.left.to_px() + m_border.left.to_px() + m_padding.left.to_px(),
};
}