diff nodejs/svg.js @ 936:a9abcdac0ae5

Fix issue of moving lightbar of testsvg.js. The lightbar does not move as expectation. It caused by compute trasnforming matrix that transform saved points from the space when saving points to current space. The transform matrix should not include matric of the owner of saved points.
author Thinker K.F. Li <thinker@codemud.net>
date Fri, 12 Nov 2010 16:53:03 +0800
parents 35b6a9411e26
children 78312b44f48c
line wrap: on
line diff
--- a/nodejs/svg.js	Fri Nov 12 16:03:19 2010 +0800
+++ b/nodejs/svg.js	Fri Nov 12 16:53:03 2010 +0800
@@ -453,8 +453,7 @@
 	var c = this.owner;
 	var mtx;
 	
-	if(c.type != "coord")
-	    c = c.parent;	// is a shape!
+	c = c.parent;
 	
 	mtx = c._mbapp_saved_rev_mtx;
 	while(c.parent && typeof c.parent != "undefined") {
@@ -469,8 +468,7 @@
 	var c = this.owner;
 	var mtx;
 	
-	if(c.type != "coord")
-	    c = c.parent;	// is a shape!
+	c = c.parent;
 
 	mtx = [c[0], c[1], c[2], c[3], c[4], c[5]];
 	while(c.parent) {
@@ -509,8 +507,7 @@
 	var c = this.owner;
 	var mtx;
 	
-	if(c.type != "coord")
-	    c = c.parent;	// is a shape!
+	c = c.parent;
 	
 	mtx = c._mbapp_saved_rev_mtx;
 	while(c.parent && typeof c.parent != "undefined") {
@@ -525,8 +522,7 @@
 	var c = this.owner;
 	var mtx;
 	
-	if(c.type != "coord")
-	    c = c.parent;	// is a shape!
+	c = c.parent;
 
 	mtx = [c[0], c[1], c[2], c[3], c[4], c[5]];
 	while(c.parent) {
@@ -611,6 +607,8 @@
      */
     get y() { return this._y; },
 
+    /*! \brief Center position in the relative space defined by parent.
+     */
     get rel() {
 	var rev;
 	var xy;