Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pyglet 1.5 maintenance #676

Merged
Merged
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
7c66f30
Added pyglet.gui to the API reference list.
Ross-TheBoss Jul 2, 2021
3b234b5
Added an "rst" file for pyglet.gui.
Ross-TheBoss Jul 2, 2021
496cec2
Added documentation to all types of widget.
Ross-TheBoss Jul 2, 2021
07d11c4
Fixed Merge Conflict
Ross-TheBoss Jul 3, 2021
4e6a45b
Added a Polygon shape making use of the GL_POLYGON flag
Ross-TheBoss Jul 3, 2021
5bdc66d
Added the ability to get and set the center of the polygon.
Ross-TheBoss Jul 3, 2021
8e38d71
Merge branch 'pyglet:pyglet-1.5-maintenance' into pyglet-1.5-maintenance
Ross-TheBoss Jul 3, 2021
e3b1b3a
Added rotation for polygons.
Ross-TheBoss Jul 3, 2021
94fa97f
Removed Polygon.center property from this branch.
Ross-TheBoss Jul 3, 2021
ce8c536
Changed the Polygon class to use GL_TRIANGLES.
Ross-TheBoss Jul 4, 2021
081b6f7
A small change to an outdated docstring in Polygon.__init__
Ross-TheBoss Jul 5, 2021
00dc94d
Fixed merge conflict
Ross-TheBoss Jul 6, 2021
3639246
Merge branch 'pyglet-pyglet-1.5-maintenance' into pyglet-1.5-maintenance
Ross-TheBoss Jul 6, 2021
4c86486
Merge branch 'pyglet:pyglet-1.5-maintenance' into pyglet-1.5-maintenance
Ross-TheBoss Jul 10, 2021
df2eaea
Merge branch 'pyglet-1.5-maintenance' of https://github.com/Ross-TheB…
Ross-TheBoss Aug 3, 2021
0e76668
Added a new Sector class in shapes.py which provides a way to draw se…
Ross-TheBoss Aug 3, 2021
ab22f9e
Fixed issue with duplicate Polygon class.
Ross-TheBoss Aug 3, 2021
252ca26
Fixed issue with duplicate Polygon class.
Ross-TheBoss Aug 3, 2021
cff3c78
Fixed bug where the first and last outer points on the Sector were jo…
Ross-TheBoss Aug 3, 2021
5d698c6
Fixed merge conflicts
Ross-TheBoss Aug 3, 2021
7b49f12
Merge branch 'pyglet-pyglet-1.5-maintenance' into pyglet-1.5-maintenance
Ross-TheBoss Aug 3, 2021
e4658fa
Fixed typos and removed redundant parenthesis. A bare try, except cla…
Ross-TheBoss Aug 8, 2021
7d0bc52
Fixed merge conflict
Ross-TheBoss Aug 8, 2021
67006e5
Merge branch 'pyglet-pyglet-1.5-maintenance' into pyglet-1.5-maintenance
Ross-TheBoss Aug 8, 2021
32269bd
Added descriptions for the border and border colour variables for the…
Ross-TheBoss Aug 8, 2021
c282602
Merge branch 'pyglet:pyglet-1.5-maintenance' into pyglet-1.5-maintenance
Ross-TheBoss Sep 1, 2021
a7376f3
Created a border_color property for the border colour of a BorderedRe…
Ross-TheBoss Sep 1, 2021
c2c6506
Added the rotation property to BorderedRectangle in shapes.py.
Ross-TheBoss Sep 1, 2021
419c9a9
Merge branch 'pyglet:pyglet-1.5-maintenance' into pyglet-1.5-maintenance
Ross-TheBoss Sep 2, 2021
3fdf9f7
Merge branch 'pyglet:pyglet-1.5-maintenance' into pyglet-1.5-maintenance
Ross-TheBoss Sep 16, 2021
b987e70
Merge branch 'pyglet-1.5-maintenance' of https://github.com/pyglet/py…
Ross-TheBoss Sep 16, 2021
e4c6556
Merge branch 'pyglet:pyglet-1.5-maintenance' into pyglet-1.5-maintenance
Ross-TheBoss Dec 12, 2021
92460d0
Merge branch 'pyglet-1.5-maintenance' of https://github.com/pyglet/py…
Ross-TheBoss Dec 12, 2021
9f1692c
Added a general rotation function to rotate vertices and changed the …
Ross-TheBoss Dec 12, 2021
c904d13
Merge remote-tracking branch 'origin/pyglet-1.5-maintenance' into pyg…
Ross-TheBoss Dec 12, 2021
4f438a0
Renamed the rotate function to _rotate to make it a private function.
Ross-TheBoss Jan 15, 2022
ed2c907
Merge branch 'pyglet:pyglet-1.5-maintenance' into pyglet-1.5-maintenance
Ross-TheBoss Aug 19, 2022
43806b9
Fixed the broken position property of the Polygon class.
Ross-TheBoss Aug 19, 2022
bcbaa92
Made the _x, _y attributes of the polygon correspond to the first coo…
Ross-TheBoss Aug 19, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions pyglet/shapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1388,6 +1388,7 @@ def __init__(self, *coordinates, color=(255, 255, 255), batch=None, group=None):

# len(self._coordinates) = the number of vertices and sides in the shape.
self._coordinates = list(coordinates)
self._x, self._y = self._coordinates[0]

self._rotation = 0

Expand Down Expand Up @@ -1434,7 +1435,7 @@ def x(self):

@x.setter
def x(self, value):
self._coordinates[0][0] = value
self._x = self._coordinates[0][0] = value
self._update_position()

@property
Expand All @@ -1447,7 +1448,7 @@ def y(self):

@y.setter
def y(self, value):
self._coordinates[0][1] = value
self._y = self._coordinates[0][1] = value
self._update_position()

@property
Expand All @@ -1464,7 +1465,11 @@ def position(self):

@position.setter
def position(self, values):
self._coordinates[0][0], self._coordinates[0][1] = values
dx = self._coordinates[0][0] - values[0]
dy = self._coordinates[0][1] - values[1]

self._coordinates = [[x - dx, y - dy] for x, y in self._coordinates]
self._x, self._y = self._coordinates[0]
self._update_position()

@property
Expand Down