Skip to content

Commit 5767735

Browse files
committed
Update debug draw for pyglet 2.1.x instead of 2.0 fix #267
1 parent 5da756c commit 5767735

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

TODO.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ v6.x
4444
- Add Canvas util module (after pyodide)
4545
- Use https://diataxis.fr/ method of organizing docs (tutorials, how-to, explanation, reference)
4646
- Make sure cffi extensions included in wheel and zip!
47-
- Catch error when NaN in debugdraw, suggest doublecheck mass=0. https://github.com/viblo/pymunk/issues/226
47+
- Catch error when NaN in debugdraw, suggest doublecheck mass=0. https://github.com/viblo/pymunk/issues/226 and https://github.com/viblo/pymunk/issues/267
4848
- Make benchmark between pymunk and pybullet. 2d bullet inspiration: https://github.com/bulletphysics/bullet3/blob/2.83/examples/Planar2D/Planar2D.cpp
4949
- After a couple of versions / time passed, re-evaluate if batch api should be separate or merged in to space.
5050
- Think about the copyright notice in some files. Keep / put everywere / remove?

pymunk/pyglet_util.py

+11-2
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,22 @@ def draw_circle(
125125
cc = pos + Vec2d.from_polar(radius, angle)
126126
color = outline_color.as_int()
127127
l = pyglet.shapes.Line(
128-
pos.x, pos.y, cc.x, cc.y, width=1, color=color, batch=self.batch, group=fg
128+
pos.x,
129+
pos.y,
130+
cc.x,
131+
cc.y,
132+
thickness=1,
133+
color=color,
134+
batch=self.batch,
135+
group=fg,
129136
)
130137
self.draw_shapes.append(l)
131138

132139
def draw_segment(self, a: Vec2d, b: Vec2d, color: SpaceDebugColor) -> None:
133140
c = color.as_int()
134-
l = pyglet.shapes.Line(a.x, a.y, b.x, b.y, width=1, color=c, batch=self.batch)
141+
l = pyglet.shapes.Line(
142+
a.x, a.y, b.x, b.y, thickness=1, color=c, batch=self.batch
143+
)
135144
self.draw_shapes.append(l)
136145

137146
def draw_fat_segment(

pyproject.toml

+1-9
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,7 @@ classifiers = [
3535
requires-python = ">=3.8"
3636

3737
[project.optional-dependencies]
38-
dev = [
39-
"pyglet < 2.0.0",
40-
"pygame",
41-
"sphinx",
42-
"aafigure",
43-
"wheel",
44-
"matplotlib",
45-
"numpy",
46-
]
38+
dev = ["pyglet", "pygame", "sphinx", "aafigure", "wheel", "matplotlib", "numpy"]
4739
[project.urls]
4840
Homepage = "https://www.pymunk.org"
4941
Documentation = "https://www.pymunk.org"

0 commit comments

Comments
 (0)