Browse Source

REVIEWED: `GuiToggleSlider()` focus on mouse-hover

Ray 2 years ago
parent
commit
5a1be66c8a
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/raygui.h

+ 2 - 1
src/raygui.h

@@ -2142,7 +2142,8 @@ int GuiToggleSlider(Rectangle bounds, const char *text, int *active)
             }
             else state = STATE_FOCUSED;
         }
-        else if (*active) state = STATE_PRESSED;
+        
+        if ((*active) && (state != STATE_FOCUSED)) state = STATE_PRESSED;
     }
 
     if (*active >= itemCount) *active = 0;