瀏覽代碼

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

Ray 2 年之前
父節點
當前提交
5a1be66c8a
共有 1 個文件被更改,包括 2 次插入1 次删除
  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;