From 21093b2f2d703d98c3f5b1cd6c627a6112e264c2 Mon Sep 17 00:00:00 2001 From: pancake Date: Mon, 19 Jan 2015 23:06:43 +0100 Subject: [PATCH] Fix graph text node align issue for negative X deltas --- libr/cons/canvas.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/libr/cons/canvas.c b/libr/cons/canvas.c index 626bcad491..b83f45d3ee 100644 --- a/libr/cons/canvas.c +++ b/libr/cons/canvas.c @@ -1,4 +1,4 @@ -/* radare - LGPL - Copyright 2013-2014 - pancake */ +/* radare - LGPL - Copyright 2013-2015 - pancake */ #include @@ -104,6 +104,7 @@ R_API void r_cons_canvas_write(RConsCanvas *c, const char *_s) { int left, slen, i, linenum = 0; char *p, *s, *str; char *line, *n; + int x, delta; if (!c || !_s || !*_s) return; @@ -122,17 +123,13 @@ R_API void r_cons_canvas_write(RConsCanvas *c, const char *_s) { slen = (c->w - (c->x-c->sx)); if (slen<1) break; - s = n; + s = n; continue; } -// top border skipping lines -//if ((c->y-1-c->sy)<-40) { -// continue; -//} -int delta = 0; -int x = c->x - c->sx -slen; -if (x<0) x=0; - if (!G (x, c->y-c->sy)) + delta = 0; + x = c->x - c->sx - slen; + // if (x<0) x = 0; + if (!G (x, c->y - c->sy)) continue; memcpy (p, line+delta, slen-delta); if (!n) break;