Skip to content

Commit

Permalink
fixing bug on some devices caused by drawing a line from point to itself
Browse files Browse the repository at this point in the history
  • Loading branch information
lucky-bai committed Aug 2, 2014
1 parent 277c5df commit 21c3c9c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected void onStart(){
super.onStart();

// Make the zoom reasonable
attacher.setScale(1.6f, 2312f, 680f, true);
attacher.setScale(1.6f, 2312f, 400f, true);

}

Expand Down
5 changes: 5 additions & 0 deletions workspace/WATisRain/src/com/lucky/watisrain/map/MapDraw.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ public void drawCircleOnMap(float x, float y, float radius, Paint paint){
*/
public void drawLineOnMap(float x1, float y1, float x2, float y2, float linewidth, Paint paint){

// Don't draw a line from a point to itself. Doing so causes a
// problem on some devices.
if(x1 == x2 && y1 == y2)
return;

float adjust_x1 = x1 * scale - offset_x;
float adjust_y1 = y1 * scale - offset_y;
float adjust_x2 = x2 * scale - offset_x;
Expand Down

0 comments on commit 21c3c9c

Please sign in to comment.