diff nodejs/svg.js @ 857:ea1e88c40548 abs_n_rel_center

Make scale work on center of an object
author Thinker K.F. Li <thinker@codemud.net>
date Mon, 20 Sep 2010 22:43:44 +0800
parents eff2f580b536
children e69f551e4a37
line wrap: on
line diff
--- a/nodejs/svg.js	Mon Sep 20 22:43:43 2010 +0800
+++ b/nodejs/svg.js	Mon Sep 20 22:43:44 2010 +0800
@@ -501,6 +501,16 @@
     /*! \brief Prevent user to modify value.
      */
     get y() { return this._y; },
+
+    get rel() {
+	var rev;
+	var xy;
+	
+	rev = this._get_ac_rev();
+	xy = _pnt_transform(this._svg_saved_x, this._svg_saved_y, rev);
+
+	return {x: xy[0], y: xy[1]};
+    },
 };
 
 loadSVG.prototype._set_bbox = function(node, tgt) {