GUI not refreshing properly(PG attached)

Hi guys,
I need to display the image of a button(using CreateImageButton) when clicked,And on clicking a button the previously selected button’s image should be invisible.But it seems like most of the times,when i toggle the image visibility of buttons, the GUI is not refreshing.When i re-scale or rotate,then GUI is updated.

Pg for reproducing the issue.

Try to toggle the buttons .If the last button’s image is still visible,try to change the viewport size and GUI will update.

Hi @madclaws
I think it’s caused by some internal caching, perhaps someone will jump in with a better explaination :slight_smile:

Either way, image._markAsDirty() forces a update.

https://www.babylonjs-playground.com/#XCPP9Y#839

.

1 Like

@aWeirdo Thanks.If i do some other gui changes after Button.image.isVisible=false, then also it is updating fine.

Sounds like a bug. @trevordev Can you take a look?

Yep, currently there are a few known issues with the invalidate rect feature. I will fix this when I get to this bug:

Thanks for reporting this.