if(me.srcMulti)
me.keepspaceLeft = 0;
else
- me.keepspaceLeft = min(0.8, absSize.y / absSize.x);
+ me.keepspaceLeft = min(0.8, absSize.x == 0 ? 0 : (absSize.y / absSize.x));
SUPER(Button).resizeNotify(me, relOrigin, relSize, absOrigin, absSize);
}
void Button_configureButton(entity me, string txt, float sz, string gfx)
SUPER(Label).resizeNotify(me, relOrigin, relSize, absOrigin, absSize);
// absSize_y is height of label
- me.realFontSize_y = me.fontSize / absSize.y;
- me.realFontSize_x = me.fontSize / absSize.x;
+ me.realFontSize_y = absSize.y == 0 ? 0 : (me.fontSize / absSize.y);
+ me.realFontSize_x = absSize.x == 0 ? 0 : (me.fontSize / absSize.x);
if(me.marginLeft)
me.keepspaceLeft = me.marginLeft * me.realFontSize.x;
if(me.marginRight)
void Slider_resizeNotify(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize)
{
SUPER(Slider).resizeNotify(me, relOrigin, relSize, absOrigin, absSize);
- me.controlWidth = absSize.y / absSize.x;
+ me.controlWidth = absSize.x == 0 ? 0 : (absSize.y / absSize.x);
}
string Slider_valueToText(entity me, float val)
{