comparison 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
comparison
equal deleted inserted replaced
798:210e4d24a3ba 799:ba6bb69ee419
267 tgt.bbox_width = parseFloat(vstr); 267 tgt.bbox_width = parseFloat(vstr);
268 268
269 a = node.attr("bbox-height"); 269 a = node.attr("bbox-height");
270 vstr = a.value(); 270 vstr = a.value();
271 tgt.bbox_height = parseFloat(vstr); 271 tgt.bbox_height = parseFloat(vstr);
272 tgt.bbox_y -= tgt.bbox_height;
272 273
273 tgt.center_x = tgt.bbox_width / 2 + tgt.bbox_x; 274 tgt.center_x = tgt.bbox_width / 2 + tgt.bbox_x;
274 a = node.attr("transform-center-x"); 275 a = node.attr("transform-center-x");
275 if(a) { 276 if(a) {
276 vstr = a.value(); 277 vstr = a.value();