Mercurial > MadButterfly
diff nodejs/svg.js @ 799:ba6bb69ee419
Fix issue of incorrect top position of bbox.
x of bbox generated by Inkscape is left-bottom corner and relative to
left-bottom corner of page. Up-direction is positive. But, in
previous implement, it assume getting a left-top corner. It is wrong,
and it is fixed, now.
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Tue, 31 Aug 2010 14:54:47 +0800 |
parents | 7ec13634c97d |
children | 843f1b5548d7 |
line wrap: on
line diff
--- a/nodejs/svg.js Tue Aug 31 14:52:12 2010 +0800 +++ b/nodejs/svg.js Tue Aug 31 14:54:47 2010 +0800 @@ -269,6 +269,7 @@ a = node.attr("bbox-height"); vstr = a.value(); tgt.bbox_height = parseFloat(vstr); + tgt.bbox_y -= tgt.bbox_height; tgt.center_x = tgt.bbox_width / 2 + tgt.bbox_x; a = node.attr("transform-center-x");