From 1a9d84e88a9de1553d0180f35cb2a7c7bc90e03f Mon Sep 17 00:00:00 2001 From: Yuchen Deng Date: Sun, 8 Apr 2018 21:43:35 +0800 Subject: [PATCH] Fix compilation warning --- source/gui/widgets/listbox.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/gui/widgets/listbox.cpp b/source/gui/widgets/listbox.cpp index d5e71b54..1101fbb8 100644 --- a/source/gui/widgets/listbox.cpp +++ b/source/gui/widgets/listbox.cpp @@ -4552,7 +4552,7 @@ namespace nana //Check if it scrolls in current screen window //condition: top of target item is not less than top edge of content view and //the bottom of target item is not greater than bottom edge of content view. - if ((screen_top + static_cast(item_px) <= logic_top) && (logic_top + static_cast(item_px) + static_cast(item_px) <= screen_bottom)) + if ((screen_top + static_cast(item_px) <= logic_top) && (logic_top + static_cast(item_px) + static_cast(item_px) <= static_cast(screen_bottom))) { int offset = (static_cast(upward ? screen_top : screen_bottom - item_px) - logic_top) / static_cast(item_px); target_idx = list.advance(init_idx, offset); @@ -4578,8 +4578,8 @@ namespace nana target_idx = list.last(); origin.y = list.distance(list.first(), target_idx) * item_px + item_px; - if (origin.y >= (screen_bottom - screen_top)) - origin.y -= (screen_bottom - screen_top); + if (origin.y >= static_cast(screen_bottom - screen_top)) + origin.y -= static_cast(screen_bottom - screen_top); else origin.y = 0; }