From ff0c76cc10ce7697a85832033b27a8d11beb9699 Mon Sep 17 00:00:00 2001 From: erg Date: Fri, 25 Mar 2011 18:03:04 +0000 Subject: [PATCH] Fix nojustify bug --- lib/common/shapes.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/common/shapes.c b/lib/common/shapes.c index 1c0789440..7369ce46b 100644 --- a/lib/common/shapes.c +++ b/lib/common/shapes.c @@ -888,15 +888,19 @@ static void poly_init(node_t * n) } /* Compute space available for label. Provides the justification borders */ - if (!mapbool(late_string(n, N_nojustify, "false")) && (dimen.y < bb.y)) { - if (isBox) - temp = bb.x; - else + if (!mapbool(late_string(n, N_nojustify, "false"))) { + if (isBox) { + ND_label(n)->space.x = MAX(dimen.x,bb.x) - spacex; + } + else if (dimen.y < bb.y) { temp = bb.x * sqrt(1.0 - SQR(dimen.y) / SQR(bb.y)); + ND_label(n)->space.x = MAX(dimen.x,temp) - spacex; + } + else + ND_label(n)->space.x = dimen.x - spacex; } else { - temp = dimen.x; + ND_label(n)->space.x = dimen.x - spacex; } - ND_label(n)->space.x = temp - spacex; temp = bb.y - min_bb.y; -- 2.40.0