From 3377e825d9fa7d9db3601ba3b19084c702861e26 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Wed, 17 Jul 2024 21:29:06 +0100 Subject: [PATCH] Codechange: Replace dropdown's magic 2 with appropriate WidgetDimension. --- src/dropdown.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dropdown.cpp b/src/dropdown.cpp index fe3e90eba6..3fde9ef74f 100644 --- a/src/dropdown.cpp +++ b/src/dropdown.cpp @@ -319,11 +319,11 @@ struct DropdownWindow : Window { } this->click_delay = 2; } else { - if (_cursor.pos.y <= this->top + 2) { + if (_cursor.pos.y <= this->top + WidgetDimensions::scaled.dropdownlist.top) { /* Cursor is above the list, set scroll up */ this->scrolling = -1; return; - } else if (_cursor.pos.y >= this->top + this->height - 2) { + } else if (_cursor.pos.y >= this->top + this->height - WidgetDimensions::scaled.dropdownlist.bottom) { /* Cursor is below list, set scroll down */ this->scrolling = 1; return;