From a3f1f6e7ce05bb764c113344b566920832335df9 Mon Sep 17 00:00:00 2001 From: Humberto Sanchez II Date: Mon, 1 Jul 2024 11:34:16 -0500 Subject: [PATCH] [Properties]: [ Now I am on the Diagram ] [https://github.com/hasii2011/ogl/issues/114] --- pyproject.toml | 4 ++-- requirements.txt | 17 ++++++++--------- src/miniogl/LollipopLine.py | 4 ++-- src/miniogl/TextShape.py | 6 +++--- 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index acd35f7..93c616b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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] diff --git a/requirements.txt b/requirements.txt index cb63e29..d256f3f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 diff --git a/src/miniogl/LollipopLine.py b/src/miniogl/LollipopLine.py index b0903be..b3962a6 100644 --- a/src/miniogl/LollipopLine.py +++ b/src/miniogl/LollipopLine.py @@ -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 diff --git a/src/miniogl/TextShape.py b/src/miniogl/TextShape.py index adfd5ce..ee2e36a 100644 --- a/src/miniogl/TextShape.py +++ b/src/miniogl/TextShape.py @@ -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: @@ -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}') @@ -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: