mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-10-14 07:17:44 +00:00
Make sure dropdowns fit in the screen by allowing the list to be above when there is not enough space
Reviewed By: Vladislav Differential Revision: D1061 fixes #4857 This was SVN commit r21379.
This commit is contained in:
@@ -156,6 +156,17 @@ bool JSI_IGUIObject::getProperty(JSContext* cx, JS::HandleObject obj, JS::Handle
|
||||
break;
|
||||
}
|
||||
|
||||
case GUIST_uint:
|
||||
{
|
||||
u32 value;
|
||||
GUI<u32>::GetSetting(e, propName, value);
|
||||
if (value >= std::numeric_limits<u32>::max())
|
||||
LOGERROR("Integer overflow on converting to GUIST_uint");
|
||||
else
|
||||
vp.set(JS::Int32Value(value));
|
||||
break;
|
||||
}
|
||||
|
||||
case GUIST_float:
|
||||
{
|
||||
float value;
|
||||
@@ -452,6 +463,19 @@ bool JSI_IGUIObject::setProperty(JSContext* cx, JS::HandleObject obj, JS::Handle
|
||||
break;
|
||||
}
|
||||
|
||||
case GUIST_uint:
|
||||
{
|
||||
u32 value;
|
||||
if (ScriptInterface::FromJSVal(cx, vp, value))
|
||||
GUI<u32>::SetSetting(e, propName, value);
|
||||
else
|
||||
{
|
||||
JS_ReportError(cx, "Cannot convert value to u32");
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case GUIST_float:
|
||||
{
|
||||
double value;
|
||||
|
||||
Reference in New Issue
Block a user