use of org.intellij.images.options.ZoomOptions in project intellij-community by JetBrains.
the class ZoomOptionsImpl method equals.
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof ZoomOptions)) {
return false;
}
ZoomOptions otherOptions = (ZoomOptions) obj;
Dimension prefferedSize = otherOptions.getPrefferedSize();
return prefferedSize != null && prefferedHeight == prefferedSize.height && prefferedWidth == prefferedSize.width && smartZooming == otherOptions.isSmartZooming() && wheelZooming == otherOptions.isWheelZooming();
}
use of org.intellij.images.options.ZoomOptions in project android by JetBrains.
the class LayeredImageEditor method setImage.
private void setImage(Image image) throws IOException {
ImageDocument document = myImageEditor.getDocument();
BufferedImage previousImage = document.getValue();
document.setValue(Utilities.getDisplayableImage(image));
String format = image.getFormat() + "/" + image.getColorMode();
String description = image.getColorProfileDescription();
if (!description.isEmpty()) {
format += ", " + description;
}
document.setFormat(format);
// from ImageEditorUI
ImageZoomModel zoomModel = myImageEditor.getZoomModel();
if (previousImage == null || !zoomModel.isZoomLevelChanged()) {
Options options = OptionsManager.getInstance().getOptions();
ZoomOptions zoomOptions = options.getEditorOptions().getZoomOptions();
zoomModel.setZoomFactor(1.0d);
if (zoomOptions.isSmartZooming()) {
Dimension preferred = zoomOptions.getPrefferedSize();
if (preferred.width > image.getWidth() && preferred.height > image.getHeight()) {
double factor = (preferred.getWidth() / (double) image.getWidth() + preferred.getHeight() / (double) image.getHeight()) / 2.0d;
zoomModel.setZoomFactor(Math.ceil(factor));
}
}
}
}
use of org.intellij.images.options.ZoomOptions in project intellij-community by JetBrains.
the class EditorOptionsImpl method equals.
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof EditorOptions)) {
return false;
}
EditorOptions otherOptions = (EditorOptions) obj;
GridOptions gridOptions = otherOptions.getGridOptions();
TransparencyChessboardOptions chessboardOptions = otherOptions.getTransparencyChessboardOptions();
ZoomOptions zoomOptions = otherOptions.getZoomOptions();
return gridOptions != null && gridOptions.equals(getGridOptions()) && chessboardOptions != null && chessboardOptions.equals(getTransparencyChessboardOptions()) && zoomOptions != null && zoomOptions.equals(getZoomOptions());
}
Aggregations