mirror of
https://github.com/openseadragon/openseadragon.git
synced 2025-01-31 23:21:42 +03:00
Rename viewport.contentAspectX to viewport.contentAspectRatio. Remove viewport.contentAspectY.
This commit is contained in:
parent
4634d90715
commit
925ba8a78e
@ -184,8 +184,7 @@ $.Viewport.prototype = {
|
||||
|
||||
this._contentBounds = bounds.rotate(this.degrees).getBoundingBox();
|
||||
this.contentSize = this._contentBounds.getSize().times(contentFactor);
|
||||
this.contentAspectX = this.contentSize.x / this.contentSize.y;
|
||||
this.contentAspectY = this.contentSize.y / this.contentSize.x;
|
||||
this._contentAspectRatio = this.contentSize.x / this.contentSize.y;
|
||||
|
||||
if (this.viewer) {
|
||||
/**
|
||||
@ -222,7 +221,7 @@ $.Viewport.prototype = {
|
||||
return this.defaultZoomLevel;
|
||||
}
|
||||
|
||||
var aspectFactor = this.contentAspectX / this.getAspectRatio();
|
||||
var aspectFactor = this._contentAspectRatio / this.getAspectRatio();
|
||||
var output;
|
||||
if (this.homeFillsViewer) { // fill the viewer and clip the image
|
||||
output = aspectFactor >= 1 ? aspectFactor : 1;
|
||||
@ -1074,8 +1073,9 @@ $.Viewport.prototype = {
|
||||
// private
|
||||
_viewportToImageDelta: function( viewerX, viewerY ) {
|
||||
var scale = this._contentBounds.width;
|
||||
return new $.Point(viewerX * (this.contentSize.x / scale),
|
||||
viewerY * ((this.contentSize.y * this.contentAspectX) / scale));
|
||||
return new $.Point(
|
||||
viewerX * this.contentSize.x / scale,
|
||||
viewerY * this.contentSize.x / scale);
|
||||
},
|
||||
|
||||
/**
|
||||
@ -1105,8 +1105,9 @@ $.Viewport.prototype = {
|
||||
// private
|
||||
_imageToViewportDelta: function( imageX, imageY ) {
|
||||
var scale = this._contentBounds.width;
|
||||
return new $.Point((imageX / this.contentSize.x) * scale,
|
||||
(imageY / this.contentSize.y / this.contentAspectX) * scale);
|
||||
return new $.Point(
|
||||
imageX / this.contentSize.x * scale,
|
||||
imageY / this.contentSize.x * scale);
|
||||
},
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user