From 42c455a7cb92def894e394f8702e081488965c50 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Thu, 10 Sep 2020 10:23:04 +0300 Subject: Cleanup --- src/ui/widget.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/ui') diff --git a/src/ui/widget.c b/src/ui/widget.c index cfd119cb..c8db73dc 100644 --- a/src/ui/widget.c +++ b/src/ui/widget.c @@ -140,7 +140,7 @@ void setPos_Widget(iWidget *d, iInt2 pos) { setFlags_Widget(d, fixedPosition_WidgetFlag, iTrue); } -void setSize_Widget(iWidget *d, iInt2 size) { +void setSize_Widget(iWidget *d, iInt2 size) { d->rect.size = size; setFlags_Widget(d, fixedSize_WidgetFlag, iTrue); } @@ -687,8 +687,11 @@ iBool isHover_Widget(const iAnyObject *d) { } iBool isSelected_Widget(const iAnyObject *d) { - iAssert(isInstance_Object(d, &Class_Widget)); - return d && (flags_Widget(d) & selected_WidgetFlag) != 0; + if (d) { + iAssert(isInstance_Object(d, &Class_Widget)); + return (flags_Widget(d) & selected_WidgetFlag) != 0; + } + return iFalse; } iBool equalWidget_Command(const char *cmd, const iWidget *widget, const char *checkCommand) { -- cgit v1.2.3