Skip to content

Commit 868f7f6

Browse files
authored
[MISC] Workaround for 'pyglet' bug. (#2385)
1 parent ca38712 commit 868f7f6

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

genesis/ext/pyrender/viewer.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,17 @@
5757
if TYPE_CHECKING:
5858
from genesis.vis.rasterizer_context import RasterizerContext
5959

60-
61-
pyglet.options["shadow_window"] = False
62-
pyglet.options["dpi_scaling"] = "real"
63-
64-
6560
MODULE_DIR = os.path.dirname(__file__)
6661

6762
HELP_TEXT_KEY = Key.I
6863
HELP_TEXT_KEYBIND_NAME = "toggle_instructions"
6964

7065

66+
pyglet.options["shadow_window"] = False
67+
if pyglet.options.get("dpi_scaling") != "real":
68+
pyglet.options["dpi_scaling"] = "real"
69+
70+
7171
class Viewer(pyglet.window.Window):
7272
"""An interactive viewer for 3D scenes.
7373

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ dependencies = [
2121
"moviepy>=2.0.0",
2222
# Used by `pyrender` to manage onscreen graphical windows
2323
# * 2.1.8 breaks headless windowing, which is used in unit tests of the interactive viewer.
24+
# * 2.0.15 <= 2.1.8 breaks old-style option overwrite for string literal.
25+
# * 2.1.10 changes default DPI scaling behavior.
2426
"pyglet>=1.5,!=2.1.8",
2527
# Used by `pyrender` to load fonts
2628
"freetype-py",

0 commit comments

Comments
 (0)