blob: a5b8aafefe314276d416e8af31aec2e86c6662e1 [file] [log] [blame]
package com.davemorrissey.labs.subscaleview;
import android.graphics.PointF;
import java.io.Serializable;
/**
* Wraps the scale, center and orientation of a displayed image for easy restoration on screen rotate.
*/
@SuppressWarnings("WeakerAccess")
public class ImageViewState implements Serializable {
private final float scale;
private final float centerX;
private final float centerY;
private final int orientation;
public ImageViewState(float scale, PointF center, int orientation) {
this.scale = scale;
this.centerX = center.x;
this.centerY = center.y;
this.orientation = orientation;
}
public float getScale() {
return scale;
}
public PointF getCenter() {
return new PointF(centerX, centerY);
}
public int getOrientation() {
return orientation;
}
}