armory3d / armory2d

2D Editor
zlib License
83 stars 24 forks source link

Update submodules #70

Closed MoritzBrueckner closed 2 years ago

MoritzBrueckner commented 2 years ago

This PR fixes https://github.com/armory3d/armory/issues/2579 by including https://github.com/armory3d/zui/commit/c24daaf245919429bae588cda7ab853248eef385. While I was on it, I also updated the Armory submodule to bring in the latest canvas fixes.

Unfortunately, it is not possible to update to the very latest Zui, since every commit after https://github.com/armory3d/zui/commit/f49b18d9a56da4401f184c60b358685e2f6577ba will completely freeze Armory2D with the following exception when clicking on a color field (using html5 because Krom doesn't print anything in VSCode):

TypeError: Cannot read properties of undefined (reading 'get_width')
    at zui_Zui.image (file:///[...]/armory2d/build/debug-html5/kha.js:36507:33)
    at Function.zui_Ext.colorWheel (file:///[...]/armory2d/build/debug-html5/kha.js:35494:5)
    at Function.boxCommands (file:///[...]/armory2d/build/debug-html5/kha.js:3169:12)
    at Function.armory_ui_Popup.render (file:///[...]/armory2d/build/debug-html5/kha.js:3524:20)
    at arm2d_Editor.onFrames (file:///[...]/armory2d/build/debug-html5/kha.js:705:20)
    at Function.kha_System.render (file:///[...]/armory2d/build/debug-html5/kha.js:7513:3)
    at animate (file:///[...]/armory2d/build/debug-html5/kha.js:8055:15)
Kha/Backends/HTML5/kha/SystemImpl.hx:62
Error: Uncaught End before you begin

Also, sliders don't work that well in any newer version of Zui since handle.value doesn't seem to be changed in real time but only if editing text in the slider is finished. Also, it doesn't seem possible to react to the event that the user has stopped dragging a slider. handle.changed seems to be already false in the frame in which the mouse is released, and in the case of slider's the UI's inputReleased value is never set (seems to be by design?). However, Armory2D needs this functionality since updating the UI size while dragging the slider that controls it will cause utter chaos. I'm a bit low on time at the moment, but if you want I can open an issue for this.

luboslenco commented 2 years ago

but if you want I can open an issue for this.

That would be great, thanks!

luboslenco commented 2 years ago

Color wheel can be fixed by adding black_white_gradient: kha.Assets.images.black_white_gradient at https://github.com/armory3d/armory2d/blob/master/Sources/arm2d/Editor.hx#L88, but still need to investigate slider behaviour before updating zui.