newcar icon indicating copy to clipboard operation
newcar copied to clipboard

[Bug] Failed to hide widget after playing

Open sheepbox8646 opened this issue 7 months ago • 0 comments

Describe the bug Before playing the animation (called app.play()), you can freely change the visible of a widget, but after playing, you can only show and cannot hide, and the widget.display.value is always keeps true.

To Reproduce Steps to reproduce the behavior:

  1. Go to directory ./examples/scene1.ts
  2. To reproduce, please type following codes:
import {Circle, createScene, move, Rect, Widget} from 'newcar'
// import TextEditor from "@newcar/mod-text-editor";
import * as nc from "newcar";

await nc.useFont('./default.ttf')

export default createScene(
  new Circle(100, {
    x: 100,
    y: 100
  })
    .setup(function *(widget) {
      yield 1
      widget.hide()
      console.log(widget.display.value)
    })
)

image

According to the image and output, you can easily discover that only a nick of time you can see the false was put into outputs, either was true.

If you are interested in this bug, please comment under the issue.

sheepbox8646 avatar Jul 23 '24 09:07 sheepbox8646