Skip to content

Commit 3bc6ab3

Browse files
committed
add offset
1 parent bc1df10 commit 3bc6ab3

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

FisherAndroidChart/FisherAndroidChart.iml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
<orderEntry type="library" exported="" scope="TEST" name="hamcrest-core-1.3" level="project" />
125125
<orderEntry type="library" exported="" name="appcompat-v7-24.2.1" level="project" />
126126
<orderEntry type="library" exported="" name="support-vector-drawable-24.2.1" level="project" />
127-
<orderEntry type="library" exported="" name="support-core-utils-24.2.1" level="project" />
128127
<orderEntry type="library" exported="" scope="TEST" name="junit-4.12" level="project" />
128+
<orderEntry type="library" exported="" name="support-core-utils-24.2.1" level="project" />
129129
</component>
130130
</module>

FisherAndroidChart/src/main/java/com/rustfisher/fisherandroidchart/BulbView.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ protected void onDraw(Canvas canvas) {
106106
*/
107107
float originX = viewWid / 2;
108108
float originY = viewHeight;
109-
float botP1_x = (float) (originX - botLineLen / 2.0);
109+
float botP1_x = (float) (originX - botLineLen / 2.0);// Left
110110
float botP1_y = originY;
111-
float botP2_x = (float) (originX + botLineLen / 2.0);
111+
float botP2_x = (float) (originX + botLineLen / 2.0);// Right
112112
float botP2_y = originY;
113113
float midP1_x = (float) (originX + botLineLen / 2.0 + botArcR);
114114
float midP1_y = botP2_y - botArcR - midHeight;
@@ -119,7 +119,7 @@ protected void onDraw(Canvas canvas) {
119119
float midP4_x = (float) (originX - botLineLen / 2.0 - botArcR);
120120
float midP4_y = originY - botArcR - midHeight;
121121

122-
canvas.drawLine(botP1_x, botP1_y, botP2_x, botP2_y, bgPaint);
122+
canvas.drawLine(botP1_x, botP1_y, botP2_x + 2, botP2_y, bgPaint); // Add offset
123123

124124
botLeftRect.set(midP3_x, viewHeight - 2 * botArcR, botP1_x + botArcR, botP1_y);
125125
canvas.drawArc(botLeftRect, 89, 91, false, bgPaint);
@@ -151,7 +151,7 @@ protected void onDraw(Canvas canvas) {
151151
headShineRectF.set((midP4_x + lineWid),
152152
(float) (midP4_y - (midP1_x - midP4_x) / 2.0 + lineWid),
153153
(midP1_x - lineWid),
154-
(float) (midP4_y + (midP1_x - midP4_x) / 2.0 - lineWid * 2));
154+
(float) (midP4_y + (midP1_x - midP4_x) / 2.0 - lineWid * 2 + 2)); // Bottom add offset
155155
canvas.drawArc(headShineRectF, 180, 180, false, shinePaint);
156156

157157
/**

app/src/main/res/layout/act_bulb_view.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
android:layout_height="200dp"
1818
android:layout_below="@id/bulb_view_1"
1919
android:layout_centerHorizontal="true"
20-
android:layout_marginTop="2dp" />
20+
android:layout_marginTop="2dp"
21+
app:lineWid="3dp" />
2122

2223
<com.rustfisher.fisherandroidchart.BulbView
2324
android:id="@+id/bulb_view_3"

0 commit comments

Comments
 (0)