|
@@ -2,6 +2,7 @@
|
|
|
|
|
|
#include <AK/AKString.h>
|
|
|
#include <AK/LogStream.h>
|
|
|
+#include <LibDraw/Orientation.h>
|
|
|
#include <LibDraw/Point.h>
|
|
|
#include <LibDraw/Size.h>
|
|
|
#include <LibDraw/TextAlignment.h>
|
|
@@ -132,6 +133,51 @@ public:
|
|
|
&& bottom() >= other.bottom();
|
|
|
}
|
|
|
|
|
|
+ int primary_offset_for_orientation(Orientation orientation) const { return m_location.primary_offset_for_orientation(orientation); }
|
|
|
+ void set_primary_offset_for_orientation(Orientation orientation, int value) { m_location.set_primary_offset_for_orientation(orientation, value); }
|
|
|
+ int secondary_offset_for_orientation(Orientation orientation) const { return m_location.secondary_offset_for_orientation(orientation); }
|
|
|
+ void set_secondary_offset_for_orientation(Orientation orientation, int value) { m_location.set_secondary_offset_for_orientation(orientation, value); }
|
|
|
+
|
|
|
+ int primary_size_for_orientation(Orientation orientation) const
|
|
|
+ {
|
|
|
+ return orientation == Orientation::Vertical ? height() : width();
|
|
|
+ }
|
|
|
+
|
|
|
+ void set_primary_size_for_orientation(Orientation orientation, int value)
|
|
|
+ {
|
|
|
+ if (orientation == Orientation::Vertical)
|
|
|
+ set_height(value);
|
|
|
+ else
|
|
|
+ set_width(value);
|
|
|
+ }
|
|
|
+
|
|
|
+ int secondary_size_for_orientation(Orientation orientation) const
|
|
|
+ {
|
|
|
+ return orientation == Orientation::Vertical ? width() : height();
|
|
|
+ }
|
|
|
+
|
|
|
+ void set_secondary_size_for_orientation(Orientation orientation, int value)
|
|
|
+ {
|
|
|
+ if (orientation == Orientation::Vertical)
|
|
|
+ set_width(value);
|
|
|
+ else
|
|
|
+ set_height(value);
|
|
|
+ }
|
|
|
+
|
|
|
+ int first_edge_for_orientation(Orientation orientation) const
|
|
|
+ {
|
|
|
+ if (orientation == Orientation::Vertical)
|
|
|
+ return top();
|
|
|
+ return left();
|
|
|
+ }
|
|
|
+
|
|
|
+ int last_edge_for_orientation(Orientation orientation) const
|
|
|
+ {
|
|
|
+ if (orientation == Orientation::Vertical)
|
|
|
+ return bottom();
|
|
|
+ return right();
|
|
|
+ }
|
|
|
+
|
|
|
int left() const { return x(); }
|
|
|
int right() const { return x() + width() - 1; }
|
|
|
int top() const { return y(); }
|