mirror of
https://github.com/radareorg/radare2.git
synced 2024-11-23 21:29:49 +00:00
Adjust edge positioning if there is a graph title
Fix whitespace
This commit is contained in:
parent
29955c4c0d
commit
f3b33640d1
@ -106,6 +106,7 @@ static bool apply_line_style(RConsCanvas *c, int x, int y, int x2, int y2,
|
||||
|
||||
R_API void r_cons_canvas_line_diagonal (RConsCanvas *c, int x, int y, int x2, int y2, RCanvasLineStyle *style) {
|
||||
if (x == x2 || y == y2) {
|
||||
style->dot_style = DOT_STYLE_NORMAL;
|
||||
r_cons_canvas_line_square (c, x, y +1, x2, y2, style);
|
||||
return;
|
||||
}
|
||||
|
@ -2818,17 +2818,16 @@ static void agraph_print_edges(RAGraph *g) {
|
||||
b_x_inc = R_EDGES_X_INC + 2 * (in_nth + 1);
|
||||
|
||||
bx = b->is_dummy ? b->x : (b->x + b_x_inc);
|
||||
ay = a->y + a->h + 1;
|
||||
ay = a->y + a->h;
|
||||
by = b->y - 1;
|
||||
|
||||
|
||||
if (many && !g->is_callgraph) {
|
||||
int t = R_EDGES_X_INC + 2 * (neighbours->length + 1);
|
||||
ax = a->is_dummy ? a->x : (a->x + a->w/2 + (t/2 - a_x_inc));
|
||||
bendpoint = bx < ax ? neighbours->length - out_nth : out_nth;
|
||||
} else {
|
||||
ax = a->is_dummy ? a->x : (a->x + a_x_inc);
|
||||
bendpoint = tm->edgectr - 1;
|
||||
bendpoint = tm->edgectr;
|
||||
}
|
||||
|
||||
if (!a->is_dummy && itn == neighbours->head && out_nth == 0 && bx > ax) {
|
||||
@ -2836,7 +2835,7 @@ static void agraph_print_edges(RAGraph *g) {
|
||||
}
|
||||
if (a->h < a->layer_height) {
|
||||
r_cons_canvas_line (g->can, ax, ay, ax, ay + a->layer_height - a->h, &style);
|
||||
ay = a->y + a->layer_height + 1;
|
||||
ay = a->y + a->layer_height;
|
||||
style.symbol = LINE_NOSYM_VERT;
|
||||
}
|
||||
if (by >= ay) {
|
||||
@ -3228,19 +3227,19 @@ static int agraph_print(RAGraph *g, int is_interactive, RCore *core, RAnalFuncti
|
||||
r_config_set_i (core->config, "asm.bytes", asm_bytes);
|
||||
r_config_set_i (core->config, "asm.cmt.right", asm_cmt_right);
|
||||
}
|
||||
if (g->title && *g->title) {
|
||||
g->can->sy ++;
|
||||
}
|
||||
if (preEdges) {
|
||||
agraph_print_edges (g);
|
||||
}
|
||||
if (g->title && *g->title) {
|
||||
g->can->sy ++;
|
||||
agraph_print_nodes (g);
|
||||
g->can->sy --;
|
||||
} else {
|
||||
agraph_print_nodes (g);
|
||||
}
|
||||
agraph_print_nodes (g);
|
||||
if (!preEdges) {
|
||||
agraph_print_edges (g);
|
||||
}
|
||||
if (g->title && *g->title) {
|
||||
g->can->sy --;
|
||||
}
|
||||
/* print the graph title */
|
||||
(void) G (-g->can->sx, -g->can->sy);
|
||||
W (g->title);
|
||||
|
Loading…
Reference in New Issue
Block a user