desktop/reservedArea: clamp to 0
ref https://github.com/hyprwm/Hyprland/discussions/12880
This commit is contained in:
parent
3aa4e02720
commit
f54dd4da4a
1 changed files with 3 additions and 2 deletions
|
|
@ -6,11 +6,12 @@ using namespace Desktop;
|
|||
// fuck me. Writing this at 11pm, and I have an in-class test tomorrow.
|
||||
// I am failing that bitch
|
||||
|
||||
CReservedArea::CReservedArea(const Vector2D& tl, const Vector2D& br) : m_initialTopLeft(tl), m_initialBottomRight(br) {
|
||||
CReservedArea::CReservedArea(const Vector2D& tl, const Vector2D& br) : m_initialTopLeft(tl.clamp({0, 0})), m_initialBottomRight(br.clamp({0, 0})) {
|
||||
calculate();
|
||||
}
|
||||
|
||||
CReservedArea::CReservedArea(double top, double right, double bottom, double left) : m_initialTopLeft(left, top), m_initialBottomRight(right, bottom) {
|
||||
CReservedArea::CReservedArea(double top, double right, double bottom, double left) :
|
||||
m_initialTopLeft(std::max(left, 0.0), std::max(top, 0.0)), m_initialBottomRight(std::max(right, 0.0), std::max(bottom, 0.0)) {
|
||||
calculate();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue