comparison ios/dw.m @ 2440:070337dd4ef7

iOS: Fix dw_draw_arc()... iOS is in raidans not degrees. Thanks wiliz on freenode.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Wed, 07 Apr 2021 19:07:46 +0000
parents f273dbf1312f
children 725a6fbb44cd
comparison
equal deleted inserted replaced
2439:af5487a11954 2440:070337dd4ef7
5549 double a2 = atan2((y2-yorigin), (x2-xorigin)); 5549 double a2 = atan2((y2-yorigin), (x2-xorigin));
5550 double dx = xorigin - x1; 5550 double dx = xorigin - x1;
5551 double dy = yorigin - y1; 5551 double dy = yorigin - y1;
5552 double r = sqrt(dx*dx + dy*dy); 5552 double r = sqrt(dx*dx + dy*dy);
5553 5553
5554 /* Convert to degrees */
5555 a1 *= (180.0 / M_PI);
5556 a2 *= (180.0 / M_PI);
5557
5558 /* Prepare to draw */ 5554 /* Prepare to draw */
5559 aPath = [UIBezierPath bezierPathWithArcCenter:CGPointMake(xorigin, yorigin) 5555 aPath = [UIBezierPath bezierPathWithArcCenter:CGPointMake(xorigin, yorigin)
5560 radius:r startAngle:a1 endAngle:a2 clockwise:NO]; 5556 radius:r startAngle:a1 endAngle:a2 clockwise:YES];
5561 } 5557 }
5562 /* If the fill flag is passed */ 5558 /* If the fill flag is passed */
5563 if(flags & DW_DRAW_FILL) 5559 if(flags & DW_DRAW_FILL)
5564 [aPath fill]; 5560 [aPath fill];
5565 else 5561 else