Skip to content

Commit

Permalink
Fixes marker overlays
Browse files Browse the repository at this point in the history
  • Loading branch information
domstoppable committed Oct 29, 2024
1 parent 09d1ada commit d0f0d79
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
---------------------------------------------------------------------------~(*)
"""
import cv2
import gl_utils
import numpy as np

from OpenGL import GL as gl
from pyglui.cygl import utils as cygl_utils
from pyglui.pyfontstash import fontstash
Expand All @@ -27,6 +29,7 @@ def __init__(
self._general_settings = general_settings
self._detection_storage = detection_storage
self._optimization_storage = optimization_storage
self._plugin = plugin

self._square_definition = np.array(
[[0, 0], [1, 0], [1, 1], [0, 1]], dtype=np.float32
Expand All @@ -46,6 +49,12 @@ def _setup_glfont(self):
self.glfont.set_color_float((0.8, 0.2, 0.1, 0.8))

def _on_gl_display(self):
gl_utils.glViewport(
self._plugin.g_pool.camera_render_rect[0],
self._plugin.g_pool.ui_render_size[1] - (self._plugin.g_pool.camera_render_rect[3] + self._plugin.g_pool.camera_render_rect[1]),
self._plugin.g_pool.camera_render_rect[2],
self._plugin.g_pool.camera_render_rect[3],
)
self._render()

def _render(self):
Expand Down

0 comments on commit d0f0d79

Please sign in to comment.