Skip to content
GitLab
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
4fb60b70
Commit
4fb60b70
authored
Jun 18, 2012
by
Tiago Peixoto
Browse files
Fix bug when drawing empty graphs.
parent
a0f67bbd
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/graph_tool/draw/cairo_draw.py
View file @
4fb60b70
...
...
@@ -738,6 +738,8 @@ def get_bb(g, pos, size, pen_width, size_scale=1, text=None, font_family=None,
def
fit_to_view
(
g
,
pos
,
geometry
,
size
,
pen_width
,
M
=
None
,
text
=
None
,
font_family
=
None
,
font_size
=
None
,
cr
=
None
):
if
g
.
num_vertices
()
==
0
:
return
[
0
,
0
],
1
if
M
is
not
None
:
pos_x
,
pos_y
=
ungroup_vector_property
(
pos
,
[
0
,
1
])
P
=
np
.
zeros
((
2
,
len
(
pos_x
.
fa
)))
...
...
src/graph_tool/draw/gtk_draw.py
View file @
4fb60b70
...
...
@@ -310,7 +310,7 @@ class GraphWidget(Gtk.DrawingArea):
def
layout_callback
(
self
):
"""Perform one step of the layout algorithm."""
if
self
.
layout_callback_id
is
None
:
if
self
.
layout_callback_id
is
None
or
self
.
g
.
num_vertices
()
==
0
:
return
False
pos_temp
=
ungroup_vector_property
(
self
.
pos
,
[
0
,
1
])
sfdp_layout
(
self
.
g
,
K
=
self
.
layout_K
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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