Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public enum DisplayType {
protected static final boolean LOG_ENABLED = false;

public static final float ZOOM_INVALID = - 1f;
private static final int ZOOM_MAX_SCALE = 8;

protected Easing mEasing = new Cubic();
protected Matrix mBaseMatrix = new Matrix();
Expand All @@ -87,6 +88,7 @@ public enum DisplayType {

private float mMaxZoom = ZOOM_INVALID;
private float mMinZoom = ZOOM_INVALID;
private int mMaxZoomScale = ZOOM_MAX_SCALE;

// true when min and max zoom are explicitly defined
private boolean mMaxZoomDefined;
Expand Down Expand Up @@ -566,7 +568,7 @@ protected float computeMaxZoom() {

float fw = (float) drawable.getIntrinsicWidth() / (float) mThisWidth;
float fh = (float) drawable.getIntrinsicHeight() / (float) mThisHeight;
float scale = Math.max(fw, fh) * 8;
float scale = Math.max(fw, fh) * mMaxZoomScale;

if (LOG_ENABLED) {
Log.i(LOG_TAG, "computeMaxZoom: " + scale);
Expand Down Expand Up @@ -1019,4 +1021,8 @@ public void run() {
public void dispose() {
clear();
}

public void setMaxZoomScale(int maxScale){
this.mMaxZoomScale = maxScale;
}
}