1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-12-25 20:11:18 +00:00

Merge pull request #323 from jashar-zenuity/master

Fixed ball-and-socket orientation bug
This commit is contained in:
arnaudroques 2020-05-12 18:25:49 +02:00 committed by GitHub
commit a332e69c6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -487,6 +487,16 @@ public class EpsGraphics {
// }
}
/**
* Converts a counter clockwise angle to a clockwise
* angle. i.e. 0 -> 360, 90 -> 270, 180 -> 180, 270 -> 90
* @param counterClockwise counter clockwise angle in degrees
* @return clockwise angle in degrees
*/
private double convertToClockwiseAngle(double counterClockwise) {
return 360.0 - counterClockwise;
}
public void epsEllipse(double x, double y, double xRadius, double yRadius, double start, double extend) {
checkCloseDone();
ensureVisible(x + xRadius, y + yRadius);
@ -507,9 +517,12 @@ public class EpsGraphics {
append(strokeWidth + " setlinewidth", true);
appendColor(color);
append("newpath", true);
final double a1 = -start + 180 + 5;
final double a2 = -start - extend + 180 - 5;
append(format(x) + " " + format(y / scale) + " " + format(xRadius) + " " + format(a1) + " " + format(a2)
final double a1 = convertToClockwiseAngle(start + extend);
final double a2 = convertToClockwiseAngle(start);
append(format(x) + " " + format(y / scale) + " " + format(xRadius) + " " + (long)a1 + " " + (long)a2
+ " arc", true);
append("stroke", true);
}