Skip to content
This repository was archived by the owner on Feb 8, 2022. It is now read-only.

Commit 3310317

Browse files
committed
stroke cap
1 parent 26e168f commit 3310317

File tree

1 file changed

+12
-1
lines changed
  • mylittlecanvas/src/main/java/com/github/florent37/mylittlecanvas/shape

1 file changed

+12
-1
lines changed

mylittlecanvas/src/main/java/com/github/florent37/mylittlecanvas/shape/ArcShape.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ public class ArcShape extends RectShape {
1414
private float startAngle;
1515
private float endAngle;
1616

17+
private float addedAngle = 0;
18+
1719
public ArcShape setRadius(float radius) {
1820
final float centerX = getCenterX();
1921
final float centerY = getCenterY();
@@ -24,6 +26,15 @@ public ArcShape setRadius(float radius) {
2426
return this;
2527
}
2628

29+
public ArcShape setAddedAngle(float addedAngle) {
30+
this.addedAngle = addedAngle;
31+
return this;
32+
}
33+
34+
public float getAddedAngle() {
35+
return addedAngle;
36+
}
37+
2738
public ArcShape setCenterX(float centerX) {
2839
return (ArcShape) super.moveCenterXTo(centerX);
2940
}
@@ -57,7 +68,7 @@ protected void update() {
5768
super.update();
5869

5970
path.reset();
60-
path.addArc(new RectF(0, 0, getWidth(), getHeight()), startAngle, endAngle);
71+
path.addArc(new RectF(0, 0, getWidth(), getHeight()), startAngle + addedAngle, endAngle + addedAngle);
6172
}
6273

6374
@NonNull

0 commit comments

Comments
 (0)