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
fee7b2c9
Commit
fee7b2c9
authored
Dec 06, 2012
by
Tiago Peixoto
Browse files
Refined positioning of vertex text labels
parent
6b2f501a
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/graph/draw/graph_cairo_draw.cc
View file @
fee7b2c9
...
@@ -436,7 +436,7 @@ public:
...
@@ -436,7 +436,7 @@ public:
if
(
text
!=
""
)
if
(
text
!=
""
)
{
{
double
text_pos
=
_attrs
.
template
get
<
double
>(
VERTEX_TEXT_POSITION
);
double
text_pos
=
_attrs
.
template
get
<
double
>(
VERTEX_TEXT_POSITION
);
if
(
text_pos
<
0
)
if
(
text_pos
==
-
1
)
{
{
cr
.
select_font_face
(
_attrs
.
template
get
<
string
>(
VERTEX_FONT_FAMILY
),
cr
.
select_font_face
(
_attrs
.
template
get
<
string
>(
VERTEX_FONT_FAMILY
),
static_cast
<
Cairo
::
FontSlant
>
(
_attrs
.
template
get
<
int32_t
>(
VERTEX_FONT_SLANT
)),
static_cast
<
Cairo
::
FontSlant
>
(
_attrs
.
template
get
<
int32_t
>(
VERTEX_FONT_SLANT
)),
...
...
src/graph_tool/draw/cairo_draw.py
View file @
fee7b2c9
...
@@ -550,7 +550,9 @@ def graph_draw(g, pos=None, vprops=None, eprops=None, vorder=None, eorder=None,
...
@@ -550,7 +550,9 @@ def graph_draw(g, pos=None, vprops=None, eprops=None, vorder=None, eorder=None,
| | correspond to an angle in radians, which will | | |
| | correspond to an angle in radians, which will | | |
| | determine where the text will be placed outside | | |
| | determine where the text will be placed outside | | |
| | the vertex. If the value is negative, the text | | |
| | the vertex. If the value is negative, the text | | |
| | will be placed inside the vertex. | | |
| | will be placed inside the vertex. If the value is | | |
| | ``-1``, the vertex size will be automatically | | |
| | increased to accommodate the text. | | |
+---------------+---------------------------------------------------+------------------------+----------------------------------+
+---------------+---------------------------------------------------+------------------------+----------------------------------+
| font_family | Font family used to draw the text. | ``str`` | ``"serif"`` |
| font_family | Font family used to draw the text. | ``str`` | ``"serif"`` |
+---------------+---------------------------------------------------+------------------------+----------------------------------+
+---------------+---------------------------------------------------+------------------------+----------------------------------+
...
...
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