Commits

alorma committed 65b2f8c Merge

Comments (0)

Files changed (1)

HoloGraphLibrary/src/com/echo/holographlibrary/LineGraph.java

 	private double rangeYRatio = 0;
 	private double rangeXRatio = 0;
 	private boolean isMaxYUserSet = false;
+	private boolean isMaxXUserSet = false;
 	private int lineToFill = -1;
 	private int indexSelected = -1;
 	private OnPointClickedListener listener;
 	}
 	public void resetXLimits(){
 		float range = getMaxX() - getMinX();
-		setRangeY(getMinX()-range*getRangeXRatio(), getMaxX()+range*getRangeXRatio());
+		setRangeX(getMinX()-range*getRangeXRatio(), getMaxX()+range*getRangeXRatio());
 	}
 	public void resetLimits() {
 		resetYLimits();
 	private void setRangeY(double min, double max){
 		minY = (float)min;
 		maxY = (float)max;
+		isMaxXUserSet = true;
 	}
 	public void setRangeX(float min, float max) {
 		minX = min;
 		return minX;
 	}
 	public float getMaxLimX(){
-		return maxX;
+		if (isMaxXUserSet) {
+			return maxX;
+		}
+		else {
+			return getMaxX();
+		}
 	}
 	public float getMaxX(){
 		float max = lines.size() > 0 ? lines.get(0).getPoint(0).getX() : 0;