- Timestamp:
- 11/06/07 23:35:12 (1 year ago)
- Files:
-
- plotkit/trunk/PlotKit/Layout.js (modified) (2 diffs)
- plotkit/trunk/PlotKit/PlotKit_Packed.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plotkit/trunk/PlotKit/Layout.js
r64 r69 244 244 245 245 else if (this.style == "pie") { 246 x = 2 * x - 0.5; 246 247 var dist = Math.sqrt((y-0.5)*(y-0.5) + (x-0.5)*(x-0.5)); 247 248 if (dist > this.options.pieRadius) … … 250 251 // TODO: actually doesn't work if we don't know how the Canvas 251 252 // lays it out, need to fix! 252 var angle = Math.atan2(y - 0.5, x - 0.5) - Math.PI/2; 253 var angle = 0.0; 254 if (y < 0.5 && x < 0.5) { 255 angle = Math.atan2(y - 0.5, x - 0.5) + 5 * Math.PI/2; 256 } 257 else { 258 angle = Math.atan2(y - 0.5, x - 0.5) + Math.PI/2; 259 } 260 253 261 for (var i = 0; i < this.slices.length; i++) { 254 262 var slice = this.slices[i]; plotkit/trunk/PlotKit/PlotKit_Packed.js
r68 r69 395 395 }else{ 396 396 if(this.style=="pie"){ 397 x=2*x-0.5; 397 398 var _71=Math.sqrt((y-0.5)*(y-0.5)+(x-0.5)*(x-0.5)); 398 399 if(_71>this.options.pieRadius){ 399 400 return null; 400 401 } 401 var _72=Math.atan2(y-0.5,x-0.5)-Math.PI/2; 402 var _72=0; 403 if(y<0.5&&x<0.5){ 404 _72=Math.atan2(y-0.5,x-0.5)+5*Math.PI/2; 405 }else{ 406 _72=Math.atan2(y-0.5,x-0.5)+Math.PI/2; 407 } 402 408 for(var i=0;i<this.slices.length;i++){ 403 409 var _73=this.slices[i];




Atom Feed for the Blog Entries