]> granicus.if.org Git - graphviz/commitdiff
add comments to rounding change, and do same to width
authorellson <devnull@localhost>
Thu, 10 Dec 2009 18:49:12 +0000 (18:49 +0000)
committerellson <devnull@localhost>
Thu, 10 Dec 2009 18:49:12 +0000 (18:49 +0000)
plugin/pango/gvtextlayout_pango.c

index 3d5141f68c137a24dbdd441b8fece64f28cca6fa..a5454c7e1eb0c8de348c866e24338906dcfdd6c4 100644 (file)
@@ -187,8 +187,8 @@ static boolean pango_textlayout(textpara_t * para, char **fontpath)
        logical_rect.height = 0;
 
     textlayout_scale = POINTS_PER_INCH / (FONT_DPI * PANGO_SCALE);
-    para->width = ROUND(logical_rect.width * textlayout_scale);
-    para->height = ROUND(logical_rect.height * textlayout_scale+1);
+    para->width = (int)(logical_rect.width * textlayout_scale + 1.0);    /* round up so that width/height are never too small */
+    para->height = (int)(logical_rect.height * textlayout_scale + 1.0);
 
     /* The y offset from baseline to 0,0 of the bitmap representation */
     iter = pango_layout_get_iter (layout);