Incuvers / iris

Incuvers Real-time Imaging System cloud proxy and UI embedded micro-service
GNU General Public License v3.0
1 stars 0 forks source link

Pygame Menu Flicker #31

Open ztnel opened 2 years ago

ztnel commented 2 years ago

Description

Menu flicker was introduced during some point of the pygame ui transition. The exact cause is unknown but the menu redraw function has 2 gfx overlay draw functions shown below:

    def draw(self):
        """
        Draw menu to surface.

        :return: None
        """
        # Draw background rectangle
        _gfxdraw.filled_polygon(self._surface, self._bgrect,
                                self._bgcolor)
        # Draw title
        _gfxdraw.filled_polygon(self._surface, self._title_polygon_pos,
                                self._bg_color_title)

When these lines are commented out the menu is static and has no redraw however it still operates properly with no flicker. The culprit is related to the pygame surface fills in-between frame redraws.

ztnel commented 2 years ago

Legacy monitor ui was tested on the same hardware and appears to work properly