MCPcopy Create free account
hub / github.com/catabriga/graphwar / paintCircle

Method paintCircle

src/Graphwar/GraphAngleDisplay.java:66–91  ·  view source on GitHub ↗
(Graphics g, double angle)

Source from the content-addressed store, hash-verified

64 }
65
66 private void paintCircle(Graphics g, double angle)
67 {
68 boolean reverse = (graphwar.getGameData().isFunctionReversed() || graphwar.getGameData().isTerrainReversed()) && !(graphwar.getGameData().isFunctionReversed() && graphwar.getGameData().isTerrainReversed());
69
70 if(reverse)
71 {
72 g.fillArc(27, 27, 60, 60, 180, -(int)Math.toDegrees(angle));
73 }
74 else
75 {
76 g.fillArc(27, 27, 60, 60, 0, (int)Math.toDegrees(angle));
77 }
78
79 g.setColor(Color.BLACK);
80 g.drawLine(4, 57, 111, 57);
81 g.drawLine(57, 5, 57, 111);
82
83 if(reverse)
84 {
85 g.drawLine(57, 57, 57-(int)(53*Math.cos(angle)), 57-(int)(53*Math.sin(angle)));
86 }
87 else
88 {
89 g.drawLine(57, 57, 57+(int)(53*Math.cos(angle)), 57-(int)(53*Math.sin(angle)));
90 }
91 }
92
93 private void paintAngleText(Graphics g, double angle)
94 {

Callers 1

paintComponentMethod · 0.95

Calls 3

isFunctionReversedMethod · 0.80
getGameDataMethod · 0.80
isTerrainReversedMethod · 0.80

Tested by

no test coverage detected