summaryrefslogtreecommitdiff
path: root/src/net/sourceforge/plantuml/ugraphic/tikz/DriverEllipseTikz.java
diff options
context:
space:
mode:
authorAndrej Shadura <andrew.shadura@collabora.co.uk>2020-03-10 16:38:20 +0100
committerAndrej Shadura <andrew.shadura@collabora.co.uk>2020-03-10 16:38:20 +0100
commit7cc8c823de644a510fcc434f39b53e5fffe66bfd (patch)
tree8f4d027284bb366734f610040c621a0c5dd0a12a /src/net/sourceforge/plantuml/ugraphic/tikz/DriverEllipseTikz.java
parent567b200b91537405689ae0ca944f121201360a6b (diff)
New upstream version 1.2020.2
Diffstat (limited to 'src/net/sourceforge/plantuml/ugraphic/tikz/DriverEllipseTikz.java')
-rw-r--r--src/net/sourceforge/plantuml/ugraphic/tikz/DriverEllipseTikz.java18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/net/sourceforge/plantuml/ugraphic/tikz/DriverEllipseTikz.java b/src/net/sourceforge/plantuml/ugraphic/tikz/DriverEllipseTikz.java
index 4c7e87f..be8948a 100644
--- a/src/net/sourceforge/plantuml/ugraphic/tikz/DriverEllipseTikz.java
+++ b/src/net/sourceforge/plantuml/ugraphic/tikz/DriverEllipseTikz.java
@@ -2,7 +2,7 @@
* PlantUML : a free UML diagram generator
* ========================================================================
*
- * (C) Copyright 2009-2017, Arnaud Roques
+ * (C) Copyright 2009-2020, Arnaud Roques
*
* Project Info: http://plantuml.com
*
@@ -58,13 +58,17 @@ public class DriverEllipseTikz implements UDriver<TikzGraphics> {
if (start == 0 && extend == 0) {
tikz.ellipse(cx, cy, width / 2, height / 2);
} else {
- throw new UnsupportedOperationException();
+ start = start + 90;
+ final double x1 = cx + Math.sin(start * Math.PI / 180.) * width / 2;
+ final double y1 = cy + Math.cos(start * Math.PI / 180.) * height / 2;
+ final double x2 = cx + Math.sin((start + extend) * Math.PI / 180.) * width / 2;
+ final double y2 = cy + Math.cos((start + extend) * Math.PI / 180.) * height / 2;
+ // start = start + 360;
+ // tikz.arc(x2, y2, (int) start, (int) (start - 45), (width + height) / 4);
+
+ tikz.arc(x1, y1, (int) ((360-(start+270))), (int) (360-((start+270+extend))), (width + height) / 4);
+ // tikz.arc(x1, y1, (int) (start + 270 + extend), (int) (start + 270), (width + height) / 4);
// // http://www.itk.ilstu.edu/faculty/javila/SVG/SVG_drawing1/elliptical_curve.htm
- // start = start + 90;
- // final double x1 = cx + Math.sin(start * Math.PI / 180.) * width / 2;
- // final double y1 = cy + Math.cos(start * Math.PI / 180.) * height / 2;
- // final double x2 = cx + Math.sin((start + extend) * Math.PI / 180.) * width / 2;
- // final double y2 = cy + Math.cos((start + extend) * Math.PI / 180.) * height / 2;
// // svg.svgEllipse(x1, y1, 1, 1, 0);
// // svg.svgEllipse(x2, y2, 1, 1, 0);
// svg.svgArcEllipse(width / 2, height / 2, x1, y1, x2, y2);