Skip to content

Commit

Permalink
Calling showWithEffect while a hide animation (from hideWithEffect) h…
Browse files Browse the repository at this point in the history
…adn't finished yet would cause the widget to become invisible
  • Loading branch information
texus committed Feb 7, 2024
1 parent a8e13f0 commit 3692950
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ TGUI 1.2 (TBD)
- Replaced getWidgetAtPosition with getWidgetAtPos
- getWidgetBelowMouseCursor was given a parameter for recursive search
- Textures with different part rects were incorrectly considered equal
- showWithEffect didn't show widget if a hide animation was still playing


TGUI 1.1 (4 November 2023)
Expand Down
5 changes: 3 additions & 2 deletions src/Widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -743,8 +743,6 @@ namespace tgui

void Widget::showWithEffect(ShowEffectType type, Duration duration)
{
setVisible(true);

// We store the state the widget is currently in. In the event another animation was already playing, we should try to
// use the current state to start our animation at, but this is not the state that the widget should end at. We must
// get this state BEFORE finishing the previous animation which is done by finishExistingConflictingAnimations.
Expand All @@ -754,6 +752,9 @@ namespace tgui

finishExistingConflictingAnimations(m_showAnimations, type);

// Show the widget AFTER finishing existing animations, as finishing a hide animation would leave the widget invisible
setVisible(true);

switch (type)
{
case ShowEffectType::Fade:
Expand Down

0 comments on commit 3692950

Please sign in to comment.