Revision f4ed769a
Added by Leszek Koltunski about 2 months ago
src/main/java/org/distorted/objectlib/helpers/FactorySticker.java | ||
---|---|---|
258 | 258 |
|
259 | 259 |
float dx = x-vx; |
260 | 260 |
float dy = y-vy; |
261 |
float d = (float)Math.sqrt(dx*dx+dy*dy);
|
|
262 |
float f = (float)Math.sqrt(r*r-d*d);
|
|
261 |
float d_squared = dx*dx+dy*dy;
|
|
262 |
float f = (float)Math.sqrt(r*r-d_squared);
|
|
263 | 263 |
float e = f / ((float)Math.sqrt(m*m+1)); |
264 | 264 |
|
265 | 265 |
if( c==0 ) |
... | ... | |
561 | 561 |
startA *= 180/PI; |
562 | 562 |
sweepA *= 180/PI; |
563 | 563 |
|
564 |
//android.util.Log.e("D", "drawing arc ox="+oX+" oy="+oY+" R="+R+" startA="+startA+" sweepA="+sweepA+" stopA="+(stopA*(180/PI))); |
|
565 |
//android.util.Log.e("D", "drawing arc v1="+v1x+" , "+v1y+" v2="+v2x+" , "+v2y+" tex: "+mTexHeight); |
|
564 |
// android.util.Log.e("D", "drawing arc ox="+oX+" oy="+oY+" R="+R+" startA="+startA+" sweepA="+sweepA+" stopA="+(stopA*(180/PI)));
|
|
565 |
// android.util.Log.e("D", "drawing arc v1="+v1x+" , "+v1y+" v2="+v2x+" , "+v2y+" tex: "+mTexHeight);
|
|
566 | 566 |
|
567 | 567 |
canvas.drawArc( left+oX-R, bottom-oY-R, left+oX+R, bottom-oY+R, startA, sweepA, false, paint); |
568 | 568 |
} |
569 | 569 |
else |
570 | 570 |
{ |
571 |
//android.util.Log.e("D", "drawing line from "+v1x+" , "+v1y+" to "+v2x+" , "+v2y); |
|
571 |
// android.util.Log.e("D", "drawing line from "+v1x+" , "+v1y+" to "+v2x+" , "+v2y);
|
|
572 | 572 |
|
573 | 573 |
canvas.drawLine( left+v1x, bottom-v1y, left+v2x, bottom-v2y, paint); |
574 | 574 |
} |
... | ... | |
642 | 642 |
public void drawRoundedPolygons(Canvas canvas, Paint paint, int left, int bottom, int color, |
643 | 643 |
int height, ObjectSticker sticker, float borders, float corners) |
644 | 644 |
{ |
645 |
//android.util.Log.d("D", "DRAW ROUNDED POLYGONS"); |
|
646 |
|
|
647 | 645 |
mTexHeight = height; |
648 | 646 |
|
649 | 647 |
float[][] strokes = sticker.getStrokes(); |
Also available in: Unified diff
minor.