Index: image-edit.dev.js
===================================================================
--- image-edit.dev.js	(revision 12441)
+++ image-edit.dev.js	(working copy)
@@ -299,8 +299,7 @@
 	},
 
 	initCrop : function(postid, image, parent) {
-		var t = this, selW = $('#imgedit-sel-width-' + postid),
-			selH = $('#imgedit-sel-height-' + postid);
+		var t = this;
 
 		t.iasapi = $(image).imgAreaSelect({
 			parent: parent,
@@ -335,13 +334,20 @@
 			},
 
 			onSelectChange: function(img, c) {
-				var sizer = imageEdit.hold.sizer;
-				selW.val( imageEdit.round(c.width / sizer) );
-				selH.val( imageEdit.round(c.height / sizer) );
+				imageEdit.setSelectionInputValues(c.width, c.height);
 			}
 		});
 	},
+	
+	setSelectionInputValues : function(newwidth, newheight) {
+		var selW = $('#imgedit-sel-width-' + this.postid),
+			selH = $('#imgedit-sel-height-' + this.postid),
+			sizer = this.hold.sizer;
 
+		selW.val( this.round(newwidth / sizer) );
+		selH.val( this.round(newheight / sizer) );
+	},
+
 	setCropSelection : function(postid, c) {
 		var sel, min = $('#imgedit-minthumb-' + postid).val() || '128:128',
 			sizer = this.hold['sizer'];
@@ -535,7 +541,7 @@
 	},
 
 	setRatioSelection : function(postid, n, el) {
-		var sel, r, x = this.intval( $('#imgedit-crop-width-' + postid).val() ),
+		var sel, r, x = parseFloat( $('#imgedit-crop-width-' + postid).val() ),
 			y = this.intval( $('#imgedit-crop-height-' + postid).val() ),
 			h = $('#image-preview-' + postid).height();
 
@@ -550,18 +556,18 @@
 			});
 
 			if ( sel = this.iasapi.getSelection(true) ) {
-				r = Math.ceil( sel.y1 + ((sel.x2 - sel.x1) / (x / y)) );
+				newy2 = sel.y1 + Math.round((sel.x2 - sel.x1) / (x / y));
 
-				if ( r > h ) {
-					r = h;
-					if ( n )
-						$('#imgedit-crop-height-' + postid).val('');
-					else
-						$('#imgedit-crop-width-' + postid).val('');
+				if ( newy2 > h ) {
+					newy2 = h;
+					newx2 = sel.x1 + Math.round((newy2 - sel.y1) * (x / y));
+				} else {
+					newx2 = sel.x2;
 				}
 
-				this.iasapi.setSelection( sel.x1, sel.y1, sel.x2, r );
+				this.iasapi.setSelection( sel.x1, sel.y1, newx2, newy2 );
 				this.iasapi.update();
+				this.setSelectionInputValues(newx2 - sel.x1, newy2 - sel.y1);
 			}
 		}
 	}
