This looks slightly nicer on very pixel-dense screens (scale factors 5 and up) than nearest neighbour fractional upscaling does.
Also fix window icon disappearing at times and the window being resized after configuration changes.
We should maybe start preserving window size also at some point, the way we do position now.
By not using SDL_RenderLogicalToWindow if it's not available.
Because of course ubuntu 20.04 has sdl 2.0.10, which of course doesn't yet have SDL_RenderLogicalToWindow which was added in 2.0.18, which is of course needed because of course SDL_SetTextInputRect takes window coordinates rather than logical coordinates. At least official static linux builds are not affected because tpt-libs uses much newer sdl.
Namely when the main window is resizeable and its size isn't the same as it would be with the active scale mode with resizing disabled.
Also fix window position not being restored when the main window is resizeable.
By zero-initializing pointers in OptionsView so they don't crash when they don't get initialized, which up until very recently they always had. In the cases of the emscripten and android ports, certain components are never created.
Another rat's nest; I'm still not entirely satisfied.
This introduces "frame personalities": one for embedded frames (emscripten), one for handheld devices and everything else that doesn't really work with windows (android), and one for everything else. For now these affect which frame options are configurable by the user and what values they are forced to take if they are not configurable, and whether optimal scale is guessed based on screen size.
Also introduce a future TouchUI config node to allow switching between normal and touch-optimized UI on android. Again, because chromebooks and other android devices with mouse and keyboard support are a thing.
Also enable debugging of debug builds of android. It took me hours to attach a stupid debugger to the process; see:
- https://www.sh-zam.com/2019/05/debugging-krita-on-android.html
- https://source.android.com/docs/core/tests/debug/gdb#app-startup
I also had to adb forward the port that lldb was supposedly talking to lldb-server over because otherwise it wouldn't attach; I don't get it either.
That is, if the PROP tool is active and is configured correctly, instead of sampling a type and activating the corresponding ElementTool, sample whichever property has been configured in the PROP tool and put the result back into the PROP tool.
The problem is that Engine outlives GameController and thus also LuaScriptInterface. The solution is to not try to access LSI's lua_State if it doesn't exist; this is the case in Engine's dtor.
This is ugly as hell and the root of the problem is the cursed ownership model of LuaComponents and Windows by Engine, which I don't think I'll be fixing any time soon.
PMODE_SPARK does weird colour ops with alpha values larger than 255, so of course it looks odd with the new code that expects alpha to be at most 255. The solution is to do the work on the spot.
Other effects may also be affected by this new assumption.
This was because brushes are not in an initialized state by default, SetRadius needs to be called on them before they can be used. This is ensured elsewhere but had not been ensured on this code path.
This is hilariously bad design and needs to be fixed sometime.
This had been overlooked for a long time because intensity defaults to 1.0f and is seldom changed. The underlying issue is that an intensity value higher than 1.0f produces fire_alpha values above 255, which the new graphics code doesn't deal with properly. That said, that code works fine for every other case, so the solution is to add a special case for when fire_alpha is used.
By refusing to exit unless the property being set is correct, rather than throwing an error when it's not and exiting anyway. It's still possible to cancel changing the current setting by exiting with Esc.
This was an unused and by default disabled element that did nothing even when enabled. 146 used to be the element ID allocated to some legacy GOL variant that I cannot be bothered to look into, and the element itself existed in this vegetative state for years to ensure some sort of compatibility that I found no trace of or reason for.
Also make the element list friendlier, both for humans and for git. The list held consecutive integers starting from 0, so it was ripe for factoring. Element ID's are skipped if the name that they would normally belong to is not a string but rather a disabler(), the closest thing to a null/nil/none value in meson.