fix: ui show() and hide() was only called when it feels like

This commit is contained in:
minjaesong
2023-09-20 16:00:18 +09:00
parent a2e9f30e30
commit a168db23de
2 changed files with 3 additions and 6 deletions

View File

@@ -50,11 +50,11 @@ import kotlin.math.roundToInt
* endOpening()
* ...
* (close has triggered)
* hide()
* doClosing()
* doClosing()
* ...
* endClosing()
* hide()
* ```
* NOTE: show/hide is a UICanvas function, while do/endSomething() is UIHandler function.
*
@@ -280,17 +280,14 @@ abstract class UICanvas(
fun setAsAlwaysVisible() {
handler.setAsAlwaysVisible()
show()
}
open fun setAsOpen() {
handler.setAsOpen()
show()
}
open fun setAsClose() {
handler.setAsClose()
hide()
}
open fun toggleOpening() {
@@ -301,13 +298,11 @@ abstract class UICanvas(
if (isVisible) {
if (!isClosing) {
setAsClose()
hide()
}
}
else {
if (!isOpening) {
setAsOpen()
show()
}
}
}

View File

@@ -229,6 +229,7 @@ void main() {
}
if (isOpening) {
if (openFired) ui.show()
openFired = false
isVisible = true
@@ -270,6 +271,7 @@ void main() {
isOpened = false
isVisible = false
openCloseCounter = 0f
ui.hide()
}
}