Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/VCLX/TCanvas    [ Add a report in this area ]  
Report #:  1970   Status: Reported
Arc(X1, Y1, X2, Y2, X3, Y3, X4, Y4: Integer) acts wrongly.
Project:  Delphi Build #:  6.163
Version:    6.0 Submitted By:   qingrui LI
Report Type:  Basic functionality failure Date Reported:  7/30/2002 6:24:49 PM
Severity:    Commonly encountered problem Last Updated: 5/2/2003 12:58:35 PM
Platform:    All platforms Internal Tracking #:  
Resolution: None  Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: (6 Total Ratings)
3.83 out of 5
Total Votes: None
Description
in the source of Arc

  Theta := RadToDeg(ArcTan2(-1*(Y3-CenterY), X3-CenterX));
  Theta2 := RadToDeg(ArcTan2(-1*(Y4-CenterY), X4-CenterX));
  Arc(X1, Y1, Width, Height, Trunc(Theta) shl 4, Trunc(Theta2 - Theta) shl 4);

since ArcTan2 results in [-pi, pi], when Theta is in 2nd quadrant and Theta2 is in 3rd quadrant, Theta2 - Theta always makes a major arc which is from Theta2 to Theta, other than Theta to Theta2.

by the way, the overload Arc(X, Y, W, H, Angle, AngleLength: Integer) is a bad idea to use integer for Angle and AngleLength.
Steps to Reproduce:
None
Workarounds
None
Attachment
None
Comments

None

Server Response from: ETNACODE01