File tree Expand file tree Collapse file tree
public/javascripts/DV/models Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -93,7 +93,11 @@ DV.model.Pages.prototype = {
9393 // Update the height for a page, when its real image has loaded.
9494 updateHeight : function ( image , pageIndex ) {
9595 var h = this . getPageHeight ( pageIndex ) ;
96- var height = image . height * ( this . zoomLevel > this . BASE_WIDTH ? 0.7 : 1.0 ) ;
96+ // we want to preserve the original image's ratio, but not it's literal height
97+ var ratio = image . height / image . width ;
98+ // the height will be adjusted according to the real width of the page taking into account the original ratio
99+ var height = this . width * ratio * ( this . zoomLevel > this . BASE_WIDTH ? 0.7 : 1.0 ) ;
100+
97101 if ( image . width < this . baseWidth ) {
98102 // Not supposed to happen, but too-small images sometimes do.
99103 height *= ( this . baseWidth / image . width ) ;
You can’t perform that action at this time.
0 commit comments