diff --git a/android-app/src/main/java/org/solovyev/android/calculator/plot/CalculatorGraph2dView.java b/android-app/src/main/java/org/solovyev/android/calculator/plot/CalculatorGraph2dView.java index f6c86f58..35d0c695 100644 --- a/android-app/src/main/java/org/solovyev/android/calculator/plot/CalculatorGraph2dView.java +++ b/android-app/src/main/java/org/solovyev/android/calculator/plot/CalculatorGraph2dView.java @@ -190,9 +190,9 @@ public class CalculatorGraph2dView extends View implements GraphView { return; } if (scroller.computeScrollOffset()) { - final float ration = getRatio(); - x0 = scroller.getCurrX() * ration; - y0 = scroller.getCurrY() * ration; + final float ratio = getRatio(); + x0 = scroller.getCurrX() * ratio; + y0 = scroller.getCurrY() * ratio; if (!scroller.isFinished()) { invalidate(); } @@ -201,15 +201,7 @@ public class CalculatorGraph2dView extends View implements GraphView { } private float eval(Function f, float x) { - float v = (float) f.eval(x); - // Calculator.log("eval " + x + "; " + v); - if (v < -10000f) { - return -10000f; - } - if (v > 10000f) { - return 10000f; - } - return v; + return (float) f.eval(x); } // distance from (x,y) to the line (x1,y1) to (x2,y2), squared, multiplied by 4 diff --git a/android-app/src/main/java/org/solovyev/android/calculator/plot/CalculatorPlotFragment.java b/android-app/src/main/java/org/solovyev/android/calculator/plot/CalculatorPlotFragment.java index 5aa7b155..7ebde5ab 100644 --- a/android-app/src/main/java/org/solovyev/android/calculator/plot/CalculatorPlotFragment.java +++ b/android-app/src/main/java/org/solovyev/android/calculator/plot/CalculatorPlotFragment.java @@ -73,7 +73,7 @@ public class CalculatorPlotFragment extends AbstractCalculatorPlotFragment { } graphView.init(FunctionViewDef.newInstance(Color.WHITE, Color.WHITE, Color.DKGRAY, getBgColor())); - graphView.setXRange((float)plotBoundaries.getXMin(), (float)plotBoundaries.getXMax()); + //graphView.setXRange((float)plotBoundaries.getXMin(), (float)plotBoundaries.getXMax()); graphView.setFunctionPlotDefs(arityFunctions); graphContainer.addView((View) graphView);