From 78ad65365ebae6433f60cf03a09e76b43c46cfa2 Mon Sep 17 00:00:00 2001 From: Ray Date: Fri, 19 May 2023 18:47:55 +0200 Subject: [PATCH] REVIEWED: Cast values to improve Zig interconnection --- src/raygui.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/raygui.h b/src/raygui.h index ac10fdb..e6c93d5 100644 --- a/src/raygui.h +++ b/src/raygui.h @@ -4513,8 +4513,8 @@ static int GuiScrollBar(Rectangle bounds, int value, int minValue, int maxValue) { if (CHECK_BOUNDS_ID(bounds, guiSliderActive)) { - if (isVertical) value += (GetMouseDelta().y/(scrollbar.height - slider.height)*valueRange); - else value += (GetMouseDelta().x/(scrollbar.width - slider.width)*valueRange); + if (isVertical) value += (int)(GetMouseDelta().y/(scrollbar.height - slider.height)*valueRange); + else value += (int)(GetMouseDelta().x/(scrollbar.width - slider.width)*valueRange); } } else @@ -4550,8 +4550,8 @@ static int GuiScrollBar(Rectangle bounds, int value, int minValue, int maxValue) } else if (IsMouseButtonDown(MOUSE_LEFT_BUTTON)) { - if (isVertical) value += (GetMouseDelta().y/(scrollbar.height - slider.height)*valueRange); - else value += (GetMouseDelta().x/(scrollbar.width - slider.width)*valueRange); + if (isVertical) value += (int)(GetMouseDelta().y/(scrollbar.height - slider.height)*valueRange); + else value += (int)(GetMouseDelta().x/(scrollbar.width - slider.width)*valueRange); } // Keyboard control on mouse hover scrollbar