]> _ Git - fluidbook-html5.git/commitdiff
wip #2286 @0:20
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 16 Oct 2018 13:15:50 +0000 (15:15 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 16 Oct 2018 13:15:50 +0000 (15:15 +0200)
js/libs/fluidbook/fluidbook.resize.js
js/libs/fluidbook/links/fluidbook.links.zoomhd.js

index 951be9ce056385e71c53dbdbd77e1b14d383715b..2eb69c2905be551d17b6ede0251bcc7e85c965ac 100644 (file)
@@ -373,7 +373,6 @@ FluidbookResize.prototype = {
         this.fluidbook.displayOnePage = (this.orientation == 'portrait');
 
         if (changeOrientation) {
-            console.warn('Orientation change! ' + this.orientation);
             $(this.fluidbook).trigger('fluidbook.resize.beforeOrientationChange');
             this.fluidbook.zoom.resetZoom();
             if(!this.fluidbook.firstTransition) {
index 5c7f54754093d37bc881588a0dad952eddffeff0..53d644429a8c0b777691a767b9995dc7ab04edcf 100644 (file)
@@ -155,7 +155,7 @@ FluidbookLinksZoomHD.prototype = {
 
     updateMovePosPct: function () {
         this.calcDragLimits();
-        this.setMovePos(this.dragXPct * (this.dragMaxX - this.dragMinX), this.dragYPct * (this.dragMaxY - this.dragMinY));
+        this.setMovePos((this.dragXPct * (this.dragMaxX - this.dragMinX)) + this.dragMinX, (this.dragYPct * (this.dragMaxY - this.dragMinY)) + this.dragMinY);
     },
 
     setMovePos: function (x, y) {
@@ -174,6 +174,8 @@ FluidbookLinksZoomHD.prototype = {
     calcDragLimits: function () {
         if (this.scale <= 1) {
             this.dragMinX = this.dragMaxX = this.dragMinY = this.dragMaxY = 0;
+            this.dragYPct = this.dragXPct = 0.5;
+
             return;
         }
         var irect = this.element.find('.zoomhdImage').get(0).getBoundingClientRect();