Skip to content

Commit

Permalink
bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
N-Coder committed Jul 18, 2024
1 parent 5ba7847 commit 806e81e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ serialize =

[bumpversion:file:pyproject.toml]

[bumpversion:file:docs/conf.py]
# [bumpversion:file:docs/conf.py]

[bumpversion:file:src/ogdf_python/__init__.py]

Expand Down
7 changes: 6 additions & 1 deletion src/ogdf_python/matplotlib/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@


def color(c):
return str(c.toString())
if c.alpha() == 255:
return str(c.toString())
else:
return str(c.toString()), c.alpha() / 255


def fillPattern(fp):
Expand Down Expand Up @@ -72,6 +75,8 @@ def strokeType(st):
return "dashdot",
elif st == ogdf.StrokeType.Dashdotdot:
return (0, (3, 5, 1, 5, 1, 5)),
elif st == getattr(ogdf.StrokeType, "None"):
return (0, (0, 10)),
else:
warnings.warn(f"Unknown StrokeType {st!r}")
return ""
Expand Down
2 changes: 1 addition & 1 deletion src/ogdf_python/matplotlib/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ def remove_edge(self, e):
coll = self.style_edges[style]
assert coll.elems[idx] == e
chgd = coll.remove_elem(idx)
if chgd:
if chgd is not None:
self.edge_styles[chgd] = (style, idx)
assert coll.elems[idx] == chgd
elif not coll.paths:
Expand Down
4 changes: 2 additions & 2 deletions src/ogdf_python/pythonize/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ def wrapper(*args, **kwargs):


def renderGraph(G):
cppyy.include("ogdf/planarity/PlanarizationGridLayout.h")
cppyy.include("ogdf/planarity/PlanarizationLayout.h")
ogdf = cppyy.gbl.ogdf
GA = ogdf.GraphAttributes(G, ogdf.GraphAttributes.all)
ogdf.PlanarizationGridLayout().call(GA)
ogdf.PlanarizationLayout().call(GA)
for n in G.nodes:
GA.label[n] = str(n.index())
return GA
Expand Down

0 comments on commit 806e81e

Please sign in to comment.