roojs-core.js
[roojs1] / roojs-ui-debug.js
index f35d373..69db572 100644 (file)
@@ -44096,18 +44096,32 @@ Roo.extend(Roo.dialog.UploadCropbox, Roo.Component,  {
         console.log(maxX);
         console.log("maxY");
         console.log(maxY);
-        
+
+        if(minX < maxX && minY < maxY) {
+            return;
+        }
+
         var x = Roo.isTouch ? e.browserEvent.touches[0].pageX : e.getPageX();
         var y = Roo.isTouch ? e.browserEvent.touches[0].pageY : e.getPageY();
         
         x = x - this.mouseX;
         y = y - this.mouseY;
         
+        console.log("MOVE LEFT / RIGHT");
+        console.log(x);
+        console.log("MOVE UP / DOWN");
+        console.log(y);
+
         var bgX = Math.ceil(x + this.previewEl.getLeft(true));
         var bgY = Math.ceil(y + this.previewEl.getTop(true));
+
+        console.log("bgX");
+        console.log(bgX);
+        console.log("bgY");
+        console.log(bgY);
         
-        bgX = (minX < bgX) ? minX : ((maxX > bgX) ? maxX : bgX);
-        bgY = (minY < bgY) ? minY : ((maxY > bgY) ? maxY : bgY);
+        // bgX = (minX < bgX) ? minX : ((maxX > bgX) ? maxX : bgX);
+        bgY = (minY > bgY) ? minY : ((maxY < bgY) ? maxY : bgY);
         
         this.previewEl.setLeft(bgX);
         this.previewEl.setTop(bgY);