Panel scale and buttons

Posted By: FBL

Panel scale and buttons - 06/05/15 09:22

Not sure if this can be called a bug, but for sure it's an annoying limitation.

Consider a panel with various buttons on it. They are placed with no pixel gap next to each other (because they share a big bitmap or the like). This looks and works fine so far.

Now we change the resolution, and for having the panel not appear out of place because it's too big, it is scaled to the right size.
While the panel scales fine - and with it all the buttons, gaps can appear between the buttons. I assume because they are bound to integer positions.
Is it possible to have a "real" scaled panel, where buttons won't leave gaps?

The workaround is somewhat... ugly and annoying: scale all position and size variables, and use integer(), scale the bitmaps, recreate the buttons and correct the gaps by using the rounded position/size data.
There has to be a nicer, faster way.

This was tested with FILTER flag applied.
Posted By: jcl

Re: Panel scale and buttons - 06/11/15 10:31

Yes, all graphics elements on a panel are positioned at integer positions. The reason was that the 2D graphics primitives all use integer, but I see that this can cause scaling problems. I'll have put this on our growing list of small things to improve in one of the next updates.
© 2024 lite-C Forums