Change regen meter stroke end-cap style to CAP_BUTT

This will prevent the end of the stroke from overlapping the beginning
This commit is contained in:
Kamiel
2018-10-08 18:49:02 +02:00
parent 82bb383883
commit da9200b6ac

View File

@@ -112,8 +112,8 @@ public class RegenMeterOverlay extends Overlay
}
Rectangle bounds = widget.getBounds();
Arc2D.Double arc = new Arc2D.Double(bounds.x + OFFSET, bounds.y + (bounds.height / 2 - DIAMETER / 2), DIAMETER, DIAMETER, 88.d, -360.d * percent, Arc2D.OPEN);
final Stroke STROKE = new BasicStroke(2f);
Arc2D.Double arc = new Arc2D.Double(bounds.x + OFFSET, bounds.y + (bounds.height / 2 - DIAMETER / 2), DIAMETER, DIAMETER, 90.d, -360.d * percent, Arc2D.OPEN);
final Stroke STROKE = new BasicStroke(2f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER);
g.setStroke(STROKE);
g.setColor(color);
g.draw(arc);