diff options
Diffstat (limited to 'src/widget.cpp')
-rw-r--r-- | src/widget.cpp | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/src/widget.cpp b/src/widget.cpp index 93a5afe95..aaa00d4d7 100644 --- a/src/widget.cpp +++ b/src/widget.cpp @@ -1964,11 +1964,7 @@ void NWidgetBackground::Draw(const Window *w) { if (this->current_x == 0 || this->current_y == 0) return; - Rect r; - r.left = this->pos_x; - r.right = this->pos_x + this->current_x - 1; - r.top = this->pos_y; - r.bottom = this->pos_y + this->current_y - 1; + Rect r = this->GetCurrentRect(); const DrawPixelInfo *dpi = _cur_dpi; if (dpi->left > r.right || dpi->left + dpi->width <= r.left || dpi->top > r.bottom || dpi->top + dpi->height <= r.top) return; @@ -2232,11 +2228,7 @@ void NWidgetScrollbar::Draw(const Window *w) { if (this->current_x == 0 || this->current_y == 0) return; - Rect r; - r.left = this->pos_x; - r.right = this->pos_x + this->current_x - 1; - r.top = this->pos_y; - r.bottom = this->pos_y + this->current_y - 1; + Rect r = this->GetCurrentRect(); const DrawPixelInfo *dpi = _cur_dpi; if (dpi->left > r.right || dpi->left + dpi->width <= r.left || dpi->top > r.bottom || dpi->top + dpi->height <= r.top) return; @@ -2615,11 +2607,7 @@ void NWidgetLeaf::Draw(const Window *w) DrawPixelInfo *old_dpi = _cur_dpi; _cur_dpi = &new_dpi; - Rect r; - r.left = this->pos_x; - r.right = this->pos_x + this->current_x - 1; - r.top = this->pos_y; - r.bottom = this->pos_y + this->current_y - 1; + Rect r = this->GetCurrentRect(); bool clicked = this->IsLowered(); switch (this->type) { |