Magic Lantern Forum

Developing Magic Lantern => Feature Requests => Topic started by: garry23 on November 18, 2019, 06:49:40 PM

Title: Lua drawing
Post by: garry23 on November 18, 2019, 06:49:40 PM
Although not a priority, whenever the Lua module gets updated, I would like to suggest/request the developers consider adding the ability to draw within a bounding box.

At the moment, if I draw a line that goes, say, over the ML menu items, that is exactly what happens, ie the line writes on top of the ML menu.

With a bounding box, rect or circle ideally, feature, you could enable that first, draw your lines etc, knowing they would be restricted to only being displayed inside the bounding box. The bounding box would then be switched to allow other drawing and bounding boxes to be specify.

Another thought is to ensure that the ML stuff is always draw after the user graphics.

As I say, not a priority.
Title: Re: Lua drawing
Post by: a1ex on November 18, 2019, 09:59:21 PM
This would require a major rewrite of the graphics backend (which is not a bad idea, as DIGIC 6/7/8 cameras would require one anyway). In other words, when upgrading the codebase to allow new ports, one has to consider these points as well.

However, I have a feeling the "bounding box" request might actually be getting close to a window system, which is probably not trivial to write from scratch, and it will definitely reinvent the wheel. Canon GUI already has one, but it's not fully understood. We also need to avoid conflicts with Canon GUI, so integrating with their window system - by reverse engineering it - could make sense.

Suggestions welcome (preferably from experienced embedded system developers).
Title: Re: Lua drawing
Post by: garry23 on November 18, 2019, 10:09:30 PM

I guessed it wouldn’t be straightforward, hence I tried a hack.

One can imagine a window being created by drawing ‘anywhere’, then using transparent rectangles around the window you wish to use, and taken out to the edges of the screen.

It works, but the issue is it erases the ML top and bottom bars, which then flash on/off despite calling the draw function.

I guess it would work if the ML bars etc, were drawn after the Lua drawing stuff.