Skip to content

Commit 77f98ef

Browse files
committed
CSSTUDIO-1928-branch2: Adjust range before computing ticks in computeTicks() in the class "AxisPart".
1 parent ddefe76 commit 77f98ef

File tree

1 file changed

+4
-3
lines changed
  • app/rtplot/src/main/java/org/csstudio/javafx/rtplot/internal

1 file changed

+4
-3
lines changed

app/rtplot/src/main/java/org/csstudio/javafx/rtplot/internal/AxisPart.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,11 +361,12 @@ protected void computeTicks(final Graphics2D gc)
361361
{
362362
if (! dirty_ticks)
363363
return;
364-
final AxisRange<T> safe_range = range;
364+
Pair<T, T> adjustedRange = ticks.adjustRange(range.getLow(), range.getHigh());
365+
range = new AxisRange<>(adjustedRange.getKey(), adjustedRange.getValue());
365366
if (horizontal)
366-
ticks.compute(safe_range.getLow(), safe_range.getHigh(), gc, getBounds().width);
367+
ticks.compute(range.getLow(), range.getHigh(), gc, getBounds().width);
367368
else
368-
ticks.compute(safe_range.getLow(), safe_range.getHigh(), gc, getBounds().height);
369+
ticks.compute(range.getLow(), range.getHigh(), gc, getBounds().height);
369370
// If ticks changed, the layout of tick labels may change
370371
requestLayout();
371372
requestRefresh();

0 commit comments

Comments
 (0)