Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tiago Peixoto
graph-tool
Commits
405e8c87
Commit
405e8c87
authored
Oct 12, 2017
by
Tiago Peixoto
Browse files
GraphWidget: Fix problem with multilevel layouts
parent
8bf627bb
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/graph_tool/draw/gtk_draw.py
View file @
405e8c87
...
...
@@ -312,8 +312,12 @@ class GraphWidget(Gtk.DrawingArea):
self
.
g
=
self
.
cg
self
.
pos
=
self
.
cpos
self
.
layout_step
=
self
.
layout_K
self
.
selected
=
self
.
g
.
own_property
(
self
.
selected
)
self
.
highlight
=
self
.
g
.
own_property
(
self
.
highlight
)
self
.
sel_edge_filt
=
self
.
g
.
own_property
(
self
.
sel_edge_filt
)
else
:
self
.
cg
=
None
if
update_layout
:
self
.
reset_layout
()
...
...
@@ -421,6 +425,9 @@ class GraphWidget(Gtk.DrawingArea):
self
.
layout_K
*=
0.75
self
.
g
=
self
.
cg
self
.
pos
=
self
.
cpos
self
.
selected
=
self
.
g
.
own_property
(
self
.
selected
)
self
.
highlight
=
self
.
g
.
own_property
(
self
.
highlight
)
self
.
sel_edge_filt
=
self
.
g
.
own_property
(
self
.
sel_edge_filt
)
self
.
layout_step
=
max
(
self
.
layout_K
,
_avg_edge_distance
(
self
.
g
,
self
.
pos
)
/
10
)
...
...
@@ -436,6 +443,9 @@ class GraphWidget(Gtk.DrawingArea):
except
StopIteration
:
self
.
g
=
self
.
ag
self
.
pos
=
self
.
apos
self
.
selected
=
self
.
g
.
own_property
(
self
.
selected
)
self
.
highlight
=
self
.
g
.
own_property
(
self
.
highlight
)
self
.
sel_edge_filt
=
self
.
g
.
own_property
(
self
.
sel_edge_filt
)
self
.
g
.
copy_property
(
self
.
cpos
,
self
.
pos
)
if
self
.
vertex_matrix
is
not
None
:
self
.
vertex_matrix
=
VertexMatrix
(
self
.
g
,
self
.
pos
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment