Closed Dismalitie closed 1 year ago
Hi Dismalitie,
Thank you for this report.
In fact it's not a bug : inside an UI event, the GUI is not updated.
If you change a widget property (size, position, color...) you need to update the UI using ui.update()
local ui = require("ui")
local win = ui.Window("UI refresh artifacts replication", 500, 500)
local button = ui.Button(win, "Click me!", 10, 10)
function button:onClick()
repeat
win.width = win.width+20
ui.update() -- to update the ui after width has changed
until win.width == 800
button.enabled = false
end
win:show()
repeat ui.update() until not win.visible
It's not perfect but it's way better 😄
I have found another workaround to prevent this resizing problem, that will be available in next LuaRT release 👍
Thanks!
While working on a project, I noticed that when resizing the window with
Window.width
orWindow.height
creates black visual artifacts in the section that is resizing. I beleive it is to do with the screen refresh and theui.update()
function. Here is some code that can be used to replicate the problem:This may also be a problem at my end with my screen, so here are my monitor specs in case you want to emulate them:
1920x1080
74.97hz
RGB
SDR (Standard Dynamic Range)
8-bit
My graphics card is a
NVIDIA GeForce RTX 2080
Thanks for reading! 👍