Skip to content

Commit

Permalink
GUI: gmodeler fix adding tool (OSGeo#4309)
Browse files Browse the repository at this point in the history
* revert 2cf98da

* fix regression introduced in f99780c
  • Loading branch information
landam authored Sep 13, 2024
1 parent d77f457 commit 2c1df9f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions gui/wxpython/gmodeler/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -941,8 +941,9 @@ def GetRelations(self, fdir=None):

result = []
for rel in self.rels:
if fdir == "from" and rel.GetFrom() == self:
result.append(rel)
if fdir == "from":
if rel.GetFrom() == self:
result.append(rel)
elif rel.GetTo() == self:
result.append(rel)

Expand Down Expand Up @@ -1577,7 +1578,7 @@ def _defineShape(self, width, height, x, y):
:param width, height: dimension of the shape
:param x, y: position of the shape
"""
ogl.EllipseShape(self, width, height)
ogl.EllipseShape.__init__(self, width, height) # noqa: PLC2801, C2801
if self.parent.GetCanvas():
self.SetCanvas(self.parent.GetCanvas())

Expand All @@ -1592,7 +1593,7 @@ def _defineShape(self, width, height, x, y):
:param width, height: dimension of the shape
:param x, y: position of the shape
"""
ogl.CompositeShape(self)
ogl.CompositeShape.__init__(self) # noqa: PLC2801, C2801
if self.parent.GetCanvas():
self.SetCanvas(self.parent.GetCanvas())

Expand Down

0 comments on commit 2c1df9f

Please sign in to comment.