diff options
Diffstat (limited to 'src/ui/widget.c')
-rw-r--r-- | src/ui/widget.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/ui/widget.c b/src/ui/widget.c index 4dd545b5..c7a23c54 100644 --- a/src/ui/widget.c +++ b/src/ui/widget.c | |||
@@ -152,7 +152,7 @@ void setId_Widget(iWidget *d, const char *id) { | |||
152 | } | 152 | } |
153 | 153 | ||
154 | const iString *id_Widget(const iWidget *d) { | 154 | const iString *id_Widget(const iWidget *d) { |
155 | return &d->id; | 155 | return d ? &d->id : collectNew_String(); |
156 | } | 156 | } |
157 | 157 | ||
158 | int64_t flags_Widget(const iWidget *d) { | 158 | int64_t flags_Widget(const iWidget *d) { |
@@ -511,7 +511,7 @@ void arrange_Widget(iWidget *d) { | |||
511 | } | 511 | } |
512 | 512 | ||
513 | static void applyVisualOffset_Widget_(const iWidget *d, iInt2 *pos) { | 513 | static void applyVisualOffset_Widget_(const iWidget *d, iInt2 *pos) { |
514 | if (d->flags & visualOffset_WidgetFlag) { | 514 | if (d->flags & (visualOffset_WidgetFlag | dragged_WidgetFlag)) { |
515 | const int off = iRound(value_Anim(&d->visualOffset)); | 515 | const int off = iRound(value_Anim(&d->visualOffset)); |
516 | if (d->flags & horizontalOffset_WidgetFlag) { | 516 | if (d->flags & horizontalOffset_WidgetFlag) { |
517 | pos->x += off; | 517 | pos->x += off; |
@@ -544,7 +544,9 @@ iInt2 localCoord_Widget(const iWidget *d, iInt2 coord) { | |||
544 | } | 544 | } |
545 | 545 | ||
546 | iBool contains_Widget(const iWidget *d, iInt2 coord) { | 546 | iBool contains_Widget(const iWidget *d, iInt2 coord) { |
547 | const iRect bounds = { zero_I2(), d->rect.size }; | 547 | const iRect bounds = { zero_I2(), addY_I2(d->rect.size, |
548 | d->flags & drawBackgroundToBottom_WidgetFlag ? | ||
549 | rootSize_Window(get_Window()).y : 0) }; | ||
548 | return contains_Rect(bounds, localCoord_Widget(d, coord)); | 550 | return contains_Rect(bounds, localCoord_Widget(d, coord)); |
549 | } | 551 | } |
550 | 552 | ||