lint changed its opinion on whether FloatMath is faster than Math. need to do some benchmarks..
http://code.google.com/p/android/issues/detail?id=36199
This commit is contained in:
@@ -19,7 +19,6 @@ import org.oscim.renderer.GLRenderer;
|
||||
import org.oscim.theme.renderinstruction.Line;
|
||||
|
||||
import android.graphics.Paint.Cap;
|
||||
import android.util.FloatMath;
|
||||
|
||||
public final class LineLayer extends Layer {
|
||||
|
||||
@@ -122,7 +121,7 @@ public final class LineLayer extends Layer {
|
||||
vx = nextX - x;
|
||||
vy = nextY - y;
|
||||
|
||||
a = FloatMath.sqrt(vx * vx + vy * vy);
|
||||
a = (float) Math.sqrt(vx * vx + vy * vy);
|
||||
|
||||
vx = (vx / a);
|
||||
vy = (vy / a);
|
||||
@@ -289,14 +288,14 @@ public final class LineLayer extends Layer {
|
||||
// Unit vector pointing back to previous node
|
||||
vx = prevX - x;
|
||||
vy = prevY - y;
|
||||
a = FloatMath.sqrt(vx * vx + vy * vy);
|
||||
a = (float) Math.sqrt(vx * vx + vy * vy);
|
||||
vx = (vx / a);
|
||||
vy = (vy / a);
|
||||
|
||||
// Unit vector pointing forward to next node
|
||||
wx = nextX - x;
|
||||
wy = nextY - y;
|
||||
a = FloatMath.sqrt(wx * wx + wy * wy);
|
||||
a = (float) Math.sqrt(wx * wx + wy * wy);
|
||||
wx = (wx / a);
|
||||
wy = (wy / a);
|
||||
|
||||
@@ -369,7 +368,7 @@ public final class LineLayer extends Layer {
|
||||
vx = prevX - x;
|
||||
vy = prevY - y;
|
||||
|
||||
a = FloatMath.sqrt(vx * vx + vy * vy);
|
||||
a = (float) Math.sqrt(vx * vx + vy * vy);
|
||||
|
||||
vx = (vx / a);
|
||||
vy = (vy / a);
|
||||
|
||||
Reference in New Issue
Block a user