diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-11-23 19:15:50 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-11-23 19:15:50 +0200 |
commit | 343c8fcf70e6eb3346e77248719a0ce8f3104624 (patch) | |
tree | f65a4c0a56b479819e6beb4548f73f45c0cbd80f /src/ui/widget.c | |
parent | e2761e75182e8fc011c3348768a7ab05f546fdc8 (diff) |
Widget: Removed the animation offset hack
Diffstat (limited to 'src/ui/widget.c')
-rw-r--r-- | src/ui/widget.c | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/src/ui/widget.c b/src/ui/widget.c index 1ab16b4f..61bbf43a 100644 --- a/src/ui/widget.c +++ b/src/ui/widget.c | |||
@@ -126,7 +126,6 @@ void init_Widget(iWidget *d) { | |||
126 | d->minSize = zero_I2(); | 126 | d->minSize = zero_I2(); |
127 | d->sizeRef = NULL; | 127 | d->sizeRef = NULL; |
128 | d->offsetRef = NULL; | 128 | d->offsetRef = NULL; |
129 | d->animOffsetRef = NULL; | ||
130 | d->bgColor = none_ColorId; | 129 | d->bgColor = none_ColorId; |
131 | d->frameColor = none_ColorId; | 130 | d->frameColor = none_ColorId; |
132 | init_Anim(&d->visualOffset, 0.0f); | 131 | init_Anim(&d->visualOffset, 0.0f); |
@@ -890,9 +889,6 @@ static void applyVisualOffset_Widget_(const iWidget *d, iInt2 *pos) { | |||
890 | pos->y += off; | 889 | pos->y += off; |
891 | } | 890 | } |
892 | } | 891 | } |
893 | if (d->animOffsetRef) { | ||
894 | pos->y -= value_Anim(d->animOffsetRef); | ||
895 | } | ||
896 | if (d->flags & refChildrenOffset_WidgetFlag) { | 892 | if (d->flags & refChildrenOffset_WidgetFlag) { |
897 | pos->x += visualOffsetByReference_Widget(d); | 893 | pos->x += visualOffsetByReference_Widget(d); |
898 | } | 894 | } |
@@ -955,12 +951,6 @@ iBool containsExpanded_Widget(const iWidget *d, iInt2 windowCoord, int expand) { | |||
955 | addY_I2(d->rect.size, | 951 | addY_I2(d->rect.size, |
956 | d->flags & drawBackgroundToBottom_WidgetFlag ? size_Root(d->root).y : 0) | 952 | d->flags & drawBackgroundToBottom_WidgetFlag ? size_Root(d->root).y : 0) |
957 | }; | 953 | }; |
958 | /* Apply the animated offset. (Visual offsets don't affect interaction.) */ | ||
959 | for (const iWidget *w = d; w; w = w->parent) { | ||
960 | if (w->animOffsetRef) { | ||
961 | windowCoord.y += value_Anim(w->animOffsetRef); | ||
962 | } | ||
963 | } | ||
964 | return contains_Rect(expand ? expanded_Rect(bounds, init1_I2(expand)) : bounds, | 954 | return contains_Rect(expand ? expanded_Rect(bounds, init1_I2(expand)) : bounds, |
965 | windowToInner_Widget(d, windowCoord)); | 955 | windowToInner_Widget(d, windowCoord)); |
966 | } | 956 | } |