diff --git a/examples/pattern.py b/examples/pattern.py index 91df0bc..24fa4a1 100644 --- a/examples/pattern.py +++ b/examples/pattern.py @@ -29,7 +29,7 @@ def on_key_press(symbol, modifiers): exit() -pins = PygletCornerPin(window, source_points=[[100,100], [700,100], [100,500], [300,300]]) +pins = PygletCornerPin(window, corners=[[100,100],[800,100],[150,500], [300,300]], source_points=[[100,100], [700,100], [100,500], [300,300]]) # event handlers for dragging: window.push_handlers(pins) diff --git a/pyglet_cornerpin/cornerpin.py b/pyglet_cornerpin/cornerpin.py index 62d127c..da9360d 100644 --- a/pyglet_cornerpin/cornerpin.py +++ b/pyglet_cornerpin/cornerpin.py @@ -109,6 +109,9 @@ class PygletCornerPin(pyglet.event.EventDispatcher): pyglet.shapes.Arc(c[0],c[1],20, thickness=2, color=(0,0,255,255), batch=self.batch) for c in self.pin_positions ] self.current_corner = None + + + self.window.view = self.transform2d_matrix(*[x for c in self.source_points for x in c], *[x for c in self.pin_positions for x in c]) def update_handles(self): for i, c in enumerate(self.pin_positions): diff --git a/pyproject.toml b/pyproject.toml index b85874e..a5fed81 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "pyglet-cornerpin" -version = "0.2.0" +version = "0.3.1" description = "Add a corner pin transform to a pyglet window" authors = ["Ruben van de Ven "] readme = "README.md"