# HG changeset patch # User hertzhaft # Date 1296910425 -3600 # Node ID fd4842f0afc72949513d368dae11801481997b67 # Parent 2e9a48dc7a0ca3571416a292377db3bdf41767c3 smoother birdZoom indicator movement; fixed bug in jQuery.offset() diff -r 2e9a48dc7a0c -r fd4842f0afc7 client/digitallibrary/jquery/jquery-1.4.4.js --- a/client/digitallibrary/jquery/jquery-1.4.4.js Fri Feb 04 00:02:06 2011 +0100 +++ b/client/digitallibrary/jquery/jquery-1.4.4.js Sat Feb 05 13:53:45 2011 +0100 @@ -6997,8 +6997,10 @@ curPosition = curElem.position(); } - curTop = calculatePosition ? curPosition.top : parseInt( curCSSTop, 10 ) || 0; - curLeft = calculatePosition ? curPosition.left : parseInt( curCSSLeft, 10 ) || 0; + // curTop = calculatePosition ? curPosition.top : parseInt( curCSSTop, 10 ) || 0; + // curLeft = calculatePosition ? curPosition.left : parseInt( curCSSLeft, 10 ) || 0; + curTop = calculatePosition ? curPosition.top : parseFloat( curCSSTop ) || 0; + curLeft = calculatePosition ? curPosition.left : parseFloat( curCSSLeft ) || 0; if ( jQuery.isFunction( options ) ) { options = options.call( elem, i, curOffset ); diff -r 2e9a48dc7a0c -r fd4842f0afc7 client/digitallibrary/jquery/jquery.digilib.js --- a/client/digitallibrary/jquery/jquery.digilib.js Fri Feb 04 00:02:06 2011 +0100 +++ b/client/digitallibrary/jquery/jquery.digilib.js Sat Feb 05 13:53:45 2011 +0100 @@ -1302,8 +1302,6 @@ fullRect = setZoomBG(data); // setup zoom background image $document.bind("mousemove.dlBirdMove", birdZoomMove); $document.bind("mouseup.dlBirdMove", birdZoomEndDrag); - // $birdZoom.bind("mousemove.dlBirdMove", birdZoomMove); - // $birdZoom.bind("mouseup.dlBirdMove", birdZoomEndDrag); return false; }; @@ -1314,8 +1312,9 @@ // move birdZoom div, keeping size newRect = birdZoomRect.copy(); newRect.addPosition(delta); - // stay within birdimage newRect.stayInside(birdImgRect); + // acount for border width + newRect.addPosition({x : -2, y : -2}); newRect.adjustDiv($birdZoom); // reflect birdview zoom position in scaler image // TODO: account for scaler position in embedded mode? @@ -1339,13 +1338,13 @@ var settings = data.settings; $document.unbind("mousemove.dlBirdMove", birdZoomMove); $document.unbind("mouseup.dlBirdMove", birdZoomEndDrag); - // $birdZoom.unbind("mousemove.dlBirdMove", birdZoomMove); - // $birdZoom.unbind("mouseup.dlBirdMove", birdZoomEndDrag); if (newRect == null) { // no movement happened - set center to click position startPos = birdZoomRect.getCenter(); birdZoomMove(evt); } + // ugly, but needed to prevent double border width compensation + newRect.addPosition({x : +2, y : +2}); var newArea = data.birdTrafo.invtransform(newRect); data.zoomArea = newArea; redisplay(data); @@ -1366,7 +1365,7 @@ // move bird zoom indicator to reflect zoomed detail area var setBirdZoom = function(data, rect) { var part = data.imgTrafo.invtransform(rect); - // area = FULL_AREA.fit(part); // we want to see where we transcend the borders + // area = FULL_AREA.fit(part); // no, we want to see where we transcend the borders birdTrafo = getImgTrafo(data.$birdImg, FULL_AREA); var birdRect = birdTrafo.transform(part); // acount for border width