changeset 1014:3441e22e2233

Ticket #2 (wrong aspect ratio in preview background when using zoom area) closed
author hertzhaft
date Sat, 18 Feb 2012 18:58:49 +0100
parents ae419ec528f1
children 5b7fd3515e4c
files webapp/src/main/webapp/jquery/jquery.digilib.js
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/webapp/src/main/webapp/jquery/jquery.digilib.js	Sat Feb 18 17:13:11 2012 +0100
+++ b/webapp/src/main/webapp/jquery/jquery.digilib.js	Sat Feb 18 18:58:49 2012 +0100
@@ -1266,8 +1266,9 @@
         };
         if (newZoomArea != null) {
         	// check if aspect ratio has changed
-        	newAspect = newZoomArea.getAspect();
-        	if (newAspect !== data.zoomArea.getAspect()) {
+        	if (Math.abs(newZoomArea.getAspect() - data.zoomArea.getAspect()) > 0.001 ) {
+        	    var newRect = data.imgTrafo.transform(newZoomArea);
+        	    var newAspect = newRect.getAspect();
         		var newSize = data.maxImgSize.fitAspect(newAspect);
         		// set scaler to presumed new size
         		newSize.adjustDiv($scaler);