Fix crash in inputbox when called with wrong arguments (negative precision for number input). Tweaked colors of icons

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1435 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Yves Rizoud 2010-04-02 15:24:33 +00:00
parent a8d7f0d01e
commit ab0d336751
3 changed files with 3 additions and 0 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 638 B

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -577,6 +577,9 @@ int L_InputBox(lua_State* L)
LUA_ARG_NUMBER(setting*args_per_setting+6, "inputbox", decimal_places[setting], -15.0, 15.0);
if (decimal_places[setting]>15)
decimal_places[setting]=15;
if (min_value[setting]!=0 || min_value[setting]!=1)
if (decimal_places[setting]<0)
decimal_places[setting]=0;
// Keep current value in range
if (decimal_places[setting]>=0)
current_value[setting] = Fround(current_value[setting], decimal_places[setting]);