Changeset 7772
- Timestamp:
- 03/23/07 09:21:42 (22 months ago)
- Location:
- trunk
- Files:
-
- 1 added
- 2 modified
-
src/gfx/shape.js (modified) (1 diff)
-
src/gfx/svg.js (modified) (2 diffs)
-
tests/gfx/test_tbbox.html (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gfx/shape.js
r7345 r7772 99 99 // (see dojo.gfx.defaultRect) 100 100 return this.bbox; // dojo.gfx.Rectangle 101 }, 102 getTransformedBoundingBox: function(){ 103 // summary: returns an array of four points or null 104 // four points represent four corners of the untransformed bounding box 105 if(!this.bbox){ 106 return null; // null 107 } 108 var g = dojo.gfx.matrix; 109 var m = this._getRealMatrix(); 110 var b = this.getBoundingBox(); 111 var r = []; 112 r.push(g.multiplyPoint(m, b.x, b.y)); 113 r.push(g.multiplyPoint(m, b.x + b.width, b.y)); 114 r.push(g.multiplyPoint(m, b.x + b.width, b.y + b.height)); 115 r.push(g.multiplyPoint(m, b.x, b.y + b.height)); 116 return r; // Array 101 117 }, 102 118 getEventSource: function(){ -
trunk/src/gfx/svg.js
r7345 r7772 171 171 172 172 _applyTransform: function() { 173 var matrix = this. _getRealMatrix();173 var matrix = this.matrix; 174 174 if(matrix){ 175 175 var tm = this.matrix; … … 354 354 this.shape = this.attachShape(rawNode); 355 355 } 356 }, 357 358 _getRealMatrix: function(){ 359 var m = this.matrix; 360 var p = this.parent; 361 while(p){ 362 if(p.matrix){ 363 m = dojo.gfx.matrix.multiply(p.matrix, m); 364 } 365 p = p.parent; 366 } 367 return m; 356 368 } 357 369 });