CreativePython 1.1.0__tar.gz → 1.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. {creativepython-1.1.0/src/CreativePython.egg-info → creativepython-1.1.1}/PKG-INFO +1 -1
  2. {creativepython-1.1.0 → creativepython-1.1.1}/pyproject.toml +1 -1
  3. {creativepython-1.1.0 → creativepython-1.1.1/src/CreativePython.egg-info}/PKG-INFO +1 -1
  4. {creativepython-1.1.0 → creativepython-1.1.1}/src/gui.py +85 -47
  5. {creativepython-1.1.0 → creativepython-1.1.1}/LICENSE +0 -0
  6. {creativepython-1.1.0 → creativepython-1.1.1}/LICENSE-PSF +0 -0
  7. {creativepython-1.1.0 → creativepython-1.1.1}/MANIFEST.in +0 -0
  8. {creativepython-1.1.0 → creativepython-1.1.1}/README.md +0 -0
  9. {creativepython-1.1.0 → creativepython-1.1.1}/setup.cfg +0 -0
  10. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/GuiHandler.py +0 -0
  11. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/GuiRenderer.py +0 -0
  12. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/RealtimeAudioPlayer.py +0 -0
  13. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/__init__.py +0 -0
  14. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/Java-Comparison-Tests/advMetricRunner.pythonSurvey.py +0 -0
  15. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/Java-Comparison-Tests/compareMetrics_Java-Vs-Python.py +0 -0
  16. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/RunMetrics.py +0 -0
  17. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/Surveyor.py +0 -0
  18. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/__init__.py +0 -0
  19. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/data/Confidence.py +0 -0
  20. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/data/Contig.py +0 -0
  21. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/data/ExtendedNote.py +0 -0
  22. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/data/Histogram.py +0 -0
  23. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/data/Judgement.py +0 -0
  24. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/data/Measurement.py +0 -0
  25. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/data/PianoRoll.py +0 -0
  26. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/data/PianoRollOld.py +0 -0
  27. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/data/__init__.py +0 -0
  28. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/data/test_ExtendedNote.py +0 -0
  29. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/data/test_Histogram.py +0 -0
  30. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/data/test_Measurement.py +0 -0
  31. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/data/test_PianoRoll_assertions.py +0 -0
  32. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/data/test_PianoRoll_integration.py +0 -0
  33. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/data/test_PianoRoll_quantization.py +0 -0
  34. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/data/test_PianoRoll_unit.py +0 -0
  35. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/metrics/Metric.py +0 -0
  36. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/metrics/ZipfMetrics.py +0 -0
  37. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/metrics/__init__.py +0 -0
  38. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/metrics/simple/ChordDensityMetric.py +0 -0
  39. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/metrics/simple/ChordDistanceMetric.py +0 -0
  40. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/metrics/simple/ChordMetric.py +0 -0
  41. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/metrics/simple/ChordNormalizedMetric.py +0 -0
  42. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/metrics/simple/ChromaticToneMetric.py +0 -0
  43. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/metrics/simple/ContourBasslineDurationMetric.py +0 -0
  44. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/metrics/simple/ContourBasslineDurationQuantizedMetric.py +0 -0
  45. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/metrics/simple/ContourBasslinePitchMetric.py +0 -0
  46. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/metrics/simple/ContourMelodyDurationMetric.py +0 -0
  47. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/metrics/simple/ContourMelodyDurationQuantizedMetric.py +0 -0
  48. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/metrics/simple/ContourMelodyPitchMetric.py +0 -0
  49. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/metrics/simple/DurationBigramMetric.py +0 -0
  50. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/metrics/simple/DurationDistanceMetric.py +0 -0
  51. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/metrics/simple/DurationMetric.py +0 -0
  52. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/metrics/simple/DurationQuantizedBigramMetric.py +0 -0
  53. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/metrics/simple/DurationQuantizedDistanceMetric.py +0 -0
  54. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/metrics/simple/DurationQuantizedMetric.py +0 -0
  55. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/metrics/simple/HarmonicBigramMetric.py +0 -0
  56. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/metrics/simple/HarmonicConsonanceMetric.py +0 -0
  57. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/metrics/simple/HarmonicIntervalMetric.py +0 -0
  58. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/metrics/simple/MelodicBigramMetric.py +0 -0
  59. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/metrics/simple/MelodicConsonanceMetric.py +0 -0
  60. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/metrics/simple/MelodicIntervalMetric.py +0 -0
  61. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/metrics/simple/PitchDistanceMetric.py +0 -0
  62. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/metrics/simple/PitchDurationMetric.py +0 -0
  63. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/metrics/simple/PitchDurationQuantizedMetric.py +0 -0
  64. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/metrics/simple/PitchMetric.py +0 -0
  65. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/metrics/simple/RestMetric.py +0 -0
  66. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/metrics/simple/__init__.py +0 -0
  67. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/metrics/simple/test_DurationMetric.py +0 -0
  68. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/metrics/simple/test_Metrics_BasicIntervalsAndBigrams.py +0 -0
  69. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/metrics/simple/test_Metrics_ChordsAndConsonance.py +0 -0
  70. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/metrics/simple/test_Metrics_ContoursAndChromatic.py +0 -0
  71. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/metrics/simple/test_Metrics_QuantizedDurationsAndDistances.py +0 -0
  72. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/metrics/simple/test_PitchMetric.py +0 -0
  73. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/metrics/simple/test_RestMetric.py +0 -0
  74. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/metrics/test_Metric.py +0 -0
  75. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/utilities/CSVWriter.py +0 -0
  76. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/utilities/PowerLawRandom.py +0 -0
  77. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/nevmuse/utilities/__init__.py +0 -0
  78. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython/notationRenderer.py +0 -0
  79. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython.egg-info/SOURCES.txt +0 -0
  80. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython.egg-info/dependency_links.txt +0 -0
  81. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython.egg-info/requires.txt +0 -0
  82. {creativepython-1.1.0 → creativepython-1.1.1}/src/CreativePython.egg-info/top_level.txt +0 -0
  83. {creativepython-1.1.0 → creativepython-1.1.1}/src/bin/libportaudio.2.dylib +0 -0
  84. {creativepython-1.1.0 → creativepython-1.1.1}/src/iannix.py +0 -0
  85. {creativepython-1.1.0 → creativepython-1.1.1}/src/image.py +0 -0
  86. {creativepython-1.1.0 → creativepython-1.1.1}/src/markov.py +0 -0
  87. {creativepython-1.1.0 → creativepython-1.1.1}/src/midi.py +0 -0
  88. {creativepython-1.1.0 → creativepython-1.1.1}/src/music.py +0 -0
  89. {creativepython-1.1.0 → creativepython-1.1.1}/src/osc.py +0 -0
  90. {creativepython-1.1.0 → creativepython-1.1.1}/src/timer.py +0 -0
  91. {creativepython-1.1.0 → creativepython-1.1.1}/src/zipf.py +0 -0
  92. {creativepython-1.1.0 → creativepython-1.1.1}/tests/testAnimate.py +0 -0
  93. {creativepython-1.1.0 → creativepython-1.1.1}/tests/testPeer.py +0 -0
  94. {creativepython-1.1.0 → creativepython-1.1.1}/tests/test_keyEvent.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: CreativePython
3
- Version: 1.1.0
3
+ Version: 1.1.1
4
4
  Summary: A Python-based software environment for developing algorithmic art projects.
5
5
  Author-email: "Dr. Bill Manaris" <manaris@cofc.edu>, Taj Ballinger <ballingertj@g.cofc.edu>, Trevor Ritchie <ritchiets@g.cofc.edu>
6
6
  License: MIT License
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "CreativePython"
7
- version = "1.1.0"
7
+ version = "1.1.1"
8
8
  description = "A Python-based software environment for developing algorithmic art projects."
9
9
  readme = "README.md"
10
10
  license = { file = "LICENSE" }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: CreativePython
3
- Version: 1.1.0
3
+ Version: 1.1.1
4
4
  Summary: A Python-based software environment for developing algorithmic art projects.
5
5
  Author-email: "Dr. Bill Manaris" <manaris@cofc.edu>, Taj Ballinger <ballingertj@g.cofc.edu>, Trevor Ritchie <ritchiets@g.cofc.edu>
6
6
  License: MIT License
@@ -2,7 +2,6 @@
2
2
  # gui.py Version 1.0 13-Mar-2026
3
3
  # Taj Ballinger, Trevor Ritchie, Bill Manaris, and Dana Hughes
4
4
  #######################################################################################
5
-
6
5
  import numpy as np
7
6
 
8
7
  from CreativePython.GuiHandler import _createHandler
@@ -1312,6 +1311,34 @@ class _Drawable(_Interactable):
1312
1311
 
1313
1312
  return x, y, width, height
1314
1313
 
1314
+ def _rotatePoints(self, xPoints, yPoints):
1315
+ """
1316
+ Rotates a list of global-coordinate points around this item's center.
1317
+ Returns (xPoints, yPoints) — post-rotation, as lists of ints.
1318
+ If rotation == 0, returns the inputs unchanged.
1319
+ """
1320
+ if self._rotation != 0:
1321
+ globalX, globalY = self._getGlobalCorner()
1322
+ cx = globalX + self._width / 2
1323
+ cy = globalY + self._height / 2
1324
+
1325
+ radians = np.radians(self._rotation)
1326
+ cos = np.cos(radians)
1327
+ sin = np.sin(radians)
1328
+
1329
+ rotatedXs = []
1330
+ rotatedYs = []
1331
+ for px, py in zip(xPoints, yPoints):
1332
+ dx = px - cx
1333
+ dy = py - cy
1334
+ rotatedXs.append(int(cx + dx * cos + dy * sin))
1335
+ rotatedYs.append(int(cy - dx * sin + dy * cos))
1336
+
1337
+ xPoints = rotatedXs
1338
+ yPoints = rotatedYs
1339
+
1340
+ return xPoints, yPoints
1341
+
1315
1342
  # ── Position ───────────────────────────────────────────────────────────────
1316
1343
 
1317
1344
  def getCenter(self):
@@ -1677,9 +1704,9 @@ class Rectangle(_Graphics):
1677
1704
  })
1678
1705
 
1679
1706
  def __str__(self):
1680
- x1, y1 = self._getGlobalCorner()
1681
- x2 = x1 + self._width
1682
- y2 = y1 + self._height
1707
+ xPoints, yPoints = self._getEndpoints()
1708
+ x1, y1 = xPoints[0], yPoints[0]
1709
+ x2, y2 = xPoints[2], yPoints[2]
1683
1710
  rotation = self.getRotation()
1684
1711
  color = self.getColor()
1685
1712
  fill = self.getFilled()
@@ -1688,21 +1715,28 @@ class Rectangle(_Graphics):
1688
1715
 
1689
1716
  # ── Coordinates ────────────────────────────────────────────────────────────────
1690
1717
 
1691
- def getEndPoints(self):
1718
+ def _getEndpoints(self):
1692
1719
  """
1693
- Returns [xPoints, yPoints]
1720
+ Returns (xPoints, yPoints) — the four pre-rotation corners, in global coordinates.
1721
+ Corner order: top-left, bottom-left, bottom-right, top-right.
1694
1722
  """
1695
- # rebuild global xPoints and yPoints, accounting for position and rotation changes
1696
- x1 = self._localCornerX
1697
- x2 = self._width
1698
- y1 = self._localCornerY
1699
- y2 = self._height
1723
+ globalX, globalY = self._getGlobalCorner()
1724
+ w = self._width
1725
+ h = self._height
1700
1726
 
1701
- xPoints = [int(x1), int(x1), int(x2), int(x2)]
1702
- yPoints = [int(y1), int(y2), int(y2), int(y1)]
1727
+ xPoints = [int(globalX), int(globalX), int(globalX + w), int(globalX + w)]
1728
+ yPoints = [int(globalY), int(globalY + h), int(globalY + h), int(globalY)]
1703
1729
 
1704
1730
  return xPoints, yPoints
1705
1731
 
1732
+ def getEndpoints(self):
1733
+ """
1734
+ Returns (xPoints, yPoints) — the four corners after rotation, in global coordinates.
1735
+ Original corner order: top-left, bottom-left, bottom-right, top-right.
1736
+ """
1737
+ xPoints, yPoints = self._getEndpoints()
1738
+ return self._rotatePoints(xPoints, yPoints)
1739
+
1706
1740
 
1707
1741
  class Oval(_Graphics):
1708
1742
  """
@@ -1976,7 +2010,7 @@ class Line(_Graphics):
1976
2010
  })
1977
2011
 
1978
2012
  def __str__(self):
1979
- xPoints, yPoints = self.getEndPoints()
2013
+ xPoints, yPoints = self._getEndpoints()
1980
2014
  x1, x2 = xPoints
1981
2015
  y1, y2 = yPoints
1982
2016
  rotation = self.getRotation()
@@ -1986,23 +2020,26 @@ class Line(_Graphics):
1986
2020
 
1987
2021
  # ── Coordinates ────────────────────────────────────────────────────────────────
1988
2022
 
1989
- def getEndPoints(self):
2023
+ def _getEndpoints(self):
1990
2024
  """
1991
- Returns [x1, y1, x2, y2, rotation]
1992
- i.e. The values needed to construct a copy of this Line.
2025
+ Returns ([x1, x2], [y1, y2]) — the two pre-rotation endpoints, in global coordinates.
1993
2026
  """
1994
- # rebuild global xPoints and yPoints, accounting for position, dimension, and rotation changes
1995
2027
  scaleX = 0 if (self._originalWidth == 0) else (self._width / self._originalWidth)
1996
2028
  scaleY = 0 if (self._originalHeight == 0) else (self._height / self._originalHeight)
1997
2029
 
1998
2030
  globalX, globalY = self._getGlobalCorner()
1999
2031
 
2000
- x1 = int(globalX + (self._xPoints[0] * scaleX))
2001
- y1 = int(globalY + (self._yPoints[0] * scaleY))
2002
- x2 = int(globalX + (self._xPoints[1] * scaleX))
2003
- y2 = int(globalY + (self._yPoints[1] * scaleY))
2032
+ xPoints = [int(globalX + (self._xPoints[i] * scaleX)) for i in range(2)]
2033
+ yPoints = [int(globalY + (self._yPoints[i] * scaleY)) for i in range(2)]
2004
2034
 
2005
- return [x1, x2], [y1, y2]
2035
+ return xPoints, yPoints
2036
+
2037
+ def getEndpoints(self):
2038
+ """
2039
+ Returns ([x1, x2], [y1, y2]) — the two endpoints after rotation, in global coordinates.
2040
+ """
2041
+ xPoints, yPoints = self._getEndpoints()
2042
+ return self._rotatePoints(xPoints, yPoints)
2006
2043
 
2007
2044
  # ── Length ────────────────────────────────────────────────────────────────
2008
2045
 
@@ -2017,7 +2054,7 @@ class Line(_Graphics):
2017
2054
  Sets the distance between the line's endpoints (in pixels).
2018
2055
  The line's second endpoint (x2, y2) moves to match.
2019
2056
  """
2020
- xPoints, yPoints = self.getEndPoints()
2057
+ xPoints, yPoints = self.getEndpoints()
2021
2058
  x1, x2 = xPoints
2022
2059
  y1, y2 = yPoints
2023
2060
 
@@ -2111,7 +2148,7 @@ class Polyline(_Graphics):
2111
2148
  })
2112
2149
 
2113
2150
  def __str__(self):
2114
- xPoints, yPoints = self.getEndPoints()
2151
+ xPoints, yPoints = self._getEndpoints()
2115
2152
  rotation = self.getRotation()
2116
2153
  color = self.getColor()
2117
2154
  thickness = self.getThickness()
@@ -2119,27 +2156,27 @@ class Polyline(_Graphics):
2119
2156
 
2120
2157
  # ── Coordinates ────────────────────────────────────────────────────────────────
2121
2158
 
2122
- def getEndPoints(self):
2159
+ def _getEndpoints(self):
2123
2160
  """
2124
- Returns [xPoints, yPoints]
2125
- i.e. The values needed to construct a copy of this Polyline.
2161
+ Returns (xPoints, yPoints) — all pre-rotation points, in global coordinates.
2126
2162
  """
2127
- # rebuild global xPoints and yPoints, accounting for position and dimension changes
2128
2163
  scaleX = 0 if (self._originalWidth == 0) else (self._width / self._originalWidth)
2129
2164
  scaleY = 0 if (self._originalHeight == 0) else (self._height / self._originalHeight)
2130
2165
 
2131
2166
  globalX, globalY = self._getGlobalCorner()
2132
- xPoints = []
2133
- yPoints = []
2134
2167
 
2135
- for i in range(len(self._xPoints)):
2136
- x = int(globalX + (self._xPoints[i] * scaleX))
2137
- y = int(globalY + (self._yPoints[i] * scaleY))
2138
- xPoints.append(x)
2139
- yPoints.append(y)
2168
+ xPoints = [int(globalX + (self._xPoints[i] * scaleX)) for i in range(len(self._xPoints))]
2169
+ yPoints = [int(globalY + (self._yPoints[i] * scaleY)) for i in range(len(self._yPoints))]
2140
2170
 
2141
2171
  return xPoints, yPoints
2142
2172
 
2173
+ def getEndpoints(self):
2174
+ """
2175
+ Returns (xPoints, yPoints) — all points after rotation, in global coordinates.
2176
+ """
2177
+ xPoints, yPoints = self._getEndpoints()
2178
+ return self._rotatePoints(xPoints, yPoints)
2179
+
2143
2180
 
2144
2181
  class Polygon(_Graphics):
2145
2182
  """
@@ -2184,7 +2221,7 @@ class Polygon(_Graphics):
2184
2221
  })
2185
2222
 
2186
2223
  def __str__(self):
2187
- xPoints, yPoints = self.getEndPoints()
2224
+ xPoints, yPoints = self._getEndpoints()
2188
2225
  rotation = self.getRotation()
2189
2226
  color = self.getColor()
2190
2227
  fill = self.getFilled()
@@ -2193,26 +2230,27 @@ class Polygon(_Graphics):
2193
2230
 
2194
2231
  # ── Coordinates ────────────────────────────────────────────────────────────────
2195
2232
 
2196
- def getEndPoints(self):
2233
+ def _getEndpoints(self):
2197
2234
  """
2198
- Returns [xPoints, yPoints, rotation]
2235
+ Returns (xPoints, yPoints) — all pre-rotation points, in global coordinates.
2199
2236
  """
2200
- # rebuild global xPoints and yPoints, accounting for position and dimension changes
2201
2237
  scaleX = 0 if (self._originalWidth == 0) else (self._width / self._originalWidth)
2202
2238
  scaleY = 0 if (self._originalHeight == 0) else (self._height / self._originalHeight)
2203
2239
 
2204
2240
  globalX, globalY = self._getGlobalCorner()
2205
- xPoints = []
2206
- yPoints = []
2207
2241
 
2208
- for i in range(len(self._xPoints)):
2209
- x = int(globalX + (self._xPoints[i] * scaleX))
2210
- y = int(globalY + (self._yPoints[i] * scaleY))
2211
- xPoints.append(x)
2212
- yPoints.append(y)
2242
+ xPoints = [int(globalX + (self._xPoints[i] * scaleX)) for i in range(len(self._xPoints))]
2243
+ yPoints = [int(globalY + (self._yPoints[i] * scaleY)) for i in range(len(self._yPoints))]
2213
2244
 
2214
2245
  return xPoints, yPoints
2215
2246
 
2247
+ def getEndpoints(self):
2248
+ """
2249
+ Returns (xPoints, yPoints) — all points after rotation, in global coordinates.
2250
+ """
2251
+ xPoints, yPoints = self._getEndpoints()
2252
+ return self._rotatePoints(xPoints, yPoints)
2253
+
2216
2254
 
2217
2255
  class Icon(_Graphics):
2218
2256
  """
File without changes
File without changes
File without changes