diff --git a/app/src/main/java/com/codigoparallevar/minicards/CanvasView.java b/app/src/main/java/com/codigoparallevar/minicards/CanvasView.java index 9498c68..ab1ac2d 100644 --- a/app/src/main/java/com/codigoparallevar/minicards/CanvasView.java +++ b/app/src/main/java/com/codigoparallevar/minicards/CanvasView.java @@ -260,7 +260,7 @@ class CanvasView extends View implements PartGrid { } } } - else if (motionMode == MotionMode.Type.LongTouch) { + else if (motionMode == MotionMode.Type.LongTouch && _devMode) { if (selectedPart != null) { selectedPart.getMoveable().drop(xInCanvas, yInCanvas); @@ -286,6 +286,10 @@ class CanvasView extends View implements PartGrid { case MotionEvent.ACTION_MOVE: { + if (!_devMode) { + break; + } + if (selectedPart == null){ int xMovement = _mouseDownPoint.item1 - xInScreen; int yMovement = _mouseDownPoint.item2 - yInScreen; @@ -296,10 +300,6 @@ class CanvasView extends View implements PartGrid { _mouseDownPoint = new Tuple2(xInScreen, yInScreen); } else { - if (!_devMode) { - break; - } - Log.i("Canvas", "X: " + xInScreen + " Y: " + yInScreen + " in drop zone " + _dropToRemoveZone + " : " + inDropZone(xInScreen, yInScreen)); @@ -449,6 +449,9 @@ class CanvasView extends View implements PartGrid { public void setDevMode(boolean devMode) { _devMode = devMode; + if (!_devMode) { + this._viewOrigin = new Tuple2<>(0, 0); + } this.invalidate(); } }