Skip to content

Commit

Permalink
<Refactor>[Properties]: <More properties XIX>
Browse files Browse the repository at this point in the history
[
Now I am on the Diagram
]

[#114]
  • Loading branch information
Humberto Sanchez II committed Jul 1, 2024
1 parent b5a8a67 commit a3f1f6e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 16 deletions.
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ keywords = ['pyut', 'graphical shapes', 'python',]

dependencies = [
'wxPython~=4.2.1',
'codeallybasic>=1.3.0',
'codeallybasic>=1.3.2',
'codeallyadvanced>=1.3.1',
'pyutmodelv2>=2.1.5',
'pyutmodelv2>=2.1.6',
]

[project.urls]
Expand Down
17 changes: 8 additions & 9 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
wheel==0.42.0
setuptools==69.1.1
twine==5.0.0
build==1.1.1
wheel==0.43.0
setuptools==70.1.1
twine==5.1.1
build==1.2.1
html-testRunner~=1.2.1
pkgversions==0.2.2
# For CirlceCI
buildlackey==1.6.3

mypy==1.9.0
mypy==1.10.1
mypy-extensions==1.0.0
types-setuptools==69.1.0.20240310
typing_extensions==4.10.0
typing_extensions==4.12.2

pyutmodelv2==2.1.5
codeallybasic==1.3.0
pyutmodelv2==2.1.6
codeallybasic==1.3.2
codeallyadvanced==1.3.1

wxPython~=4.2.1
4 changes: 2 additions & 2 deletions src/miniogl/LollipopLine.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ def _calculateWhereToDrawLollipop(self, attachmentPoint, xDest, yDest):
of the line
"""

diagram = self.GetDiagram()
panel = diagram.GetPanel() # to enable debugging and unit tests
diagram = self.diagram
panel = diagram.panel # to enable debugging and unit tests
ratio = panel.currentZoom

lollipopLength: int = LollipopLine.LOLLIPOP_LINE_LENGTH * ratio
Expand Down
6 changes: 3 additions & 3 deletions src/miniogl/TextShape.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def Attach(self, diagram):
"""
# RectangleShape.Attach(self, diagram)
super().Attach(diagram)
self._textBackgroundColor = self._diagram.GetPanel().GetBackgroundColour()
self._textBackgroundColor = self._diagram.panel.GetBackgroundColour()

@property
def text(self) -> str:
Expand Down Expand Up @@ -183,7 +183,7 @@ def UpdateFromModel(self):
# RectangleShape.UpdateFromModel(self)
super().UpdateFromModel()
# get the diagram frame ratio between the shape and the model
ratio = self.GetDiagram().GetPanel().GetCurrentZoom()
ratio = self.diagram.panel.currentZoom

fontSize = round(self.model.GetFontSize() * ratio)
TextShape.clsLogger.debug(f'UpdateFromModel - ratio: {ratio}')
Expand All @@ -202,7 +202,7 @@ def UpdateModel(self):

# get the ratio between the model and the shape (view) from
# the diagram frame where the shape is displayed.
ratio = self.GetDiagram().GetPanel().currentZoom
ratio = self.diagram.panel.currentZoom

# TextShape.clsLogger.debug(f'UpdateModel - ratio: {ratio}')
if self.font is not None:
Expand Down

0 comments on commit a3f1f6e

Please sign in to comment.