diff --git a/app/rtplot/src/main/java/org/csstudio/javafx/rtplot/RTImagePlot.java b/app/rtplot/src/main/java/org/csstudio/javafx/rtplot/RTImagePlot.java index 6b46d64caa..88a661edd3 100644 --- a/app/rtplot/src/main/java/org/csstudio/javafx/rtplot/RTImagePlot.java +++ b/app/rtplot/src/main/java/org/csstudio/javafx/rtplot/RTImagePlot.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2014-2020 Oak Ridge National Laboratory. + * Copyright (c) 2014-2022 Oak Ridge National Laboratory. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -443,10 +443,10 @@ public void setCrosshairLocation(final double x_val, final double y_val) } /** Set axis range for 'full' image - * @param min_x - * @param max_x - * @param min_y - * @param max_y + * @param min_x User coordinates + * @param max_x ... + * @param min_y ... + * @param max_y ... */ public void setAxisRange(final double min_x, final double max_x, final double min_y, final double max_y) diff --git a/app/rtplot/src/main/java/org/csstudio/javafx/rtplot/internal/ImagePlot.java b/app/rtplot/src/main/java/org/csstudio/javafx/rtplot/internal/ImagePlot.java index 649c9cbdee..07886866bb 100644 --- a/app/rtplot/src/main/java/org/csstudio/javafx/rtplot/internal/ImagePlot.java +++ b/app/rtplot/src/main/java/org/csstudio/javafx/rtplot/internal/ImagePlot.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2015-2020 Oak Ridge National Laboratory. + * Copyright (c) 2015-2022 Oak Ridge National Laboratory. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -237,18 +237,28 @@ public ColorMappingFunction getColorMapping() } /** Set axis range for 'full' image - * @param min_x - * @param max_x - * @param min_y - * @param max_y + * @param min_x User coordinates + * @param max_x ... + * @param min_y ... + * @param max_y ... */ public void setAxisRange(final double min_x, final double max_x, final double min_y, final double max_y) { + // Ignore if there are no changes, because otherwise + // each call would reset axes that had "zoomed" into the image + if (this.min_x == min_x && + this.max_x == max_x && + this.min_y == min_y && + this.max_y == max_y) + return; + + // Update the full image size this.min_x = min_x; this.max_x = max_x; this.min_y = min_y; this.max_y = max_y; + // .. and set axes to show complete image x_axis.setValueRange(min_x, max_x); y_axis.setValueRange(min_y, max_y); }