Skip to content

Commit

Permalink
Fix recenter crossline when zooming. Fix image position when resizing…
Browse files Browse the repository at this point in the history
… the canvas.
  • Loading branch information
nroduit committed Dec 20, 2024
1 parent e465f10 commit fb06141
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ public void replaceView(ViewCanvas<E> oldView2d, ViewCanvas<E> newView2d) {

if (!view2ds.isEmpty()) {
if (selectedImagePane == null) {
selectedImagePane = view2ds.get(0);
selectedImagePane = view2ds.getFirst();
}
MouseActions mouseActions = eventManager.getMouseActions();
boolean tiledMode = SynchData.Mode.TILE.equals(synchView.getSynchData().getMode());
Expand Down Expand Up @@ -661,9 +661,9 @@ public void windowClosing(WindowEvent e) {
fullscreenDialog.removeAll();
fullscreenDialog.dispose();
add(grid, BorderLayout.CENTER);
}

defaultView2d.getJComponent().requestFocusInWindow();
defaultView2d.getJComponent().requestFocusInWindow();
}
}

/** Return the image in the image display panel. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ private void componentResized() {
*/
if (currentZoom <= 0.0) {
zoom(0.0);
} else {
zoom(currentZoom);
}
if (panner != null) {
panner.updateImageSize();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,12 @@ public void propertyChange(PropertyChangeEvent evt) {
// }
}

@Override
public void zoom(Double viewScale) {
super.zoom(viewScale);
computeCrosslines(0);
}

@Override
protected void drawOnTop(Graphics2D g2d) {
MprAxis axis = getMprAxis();
Expand Down

0 comments on commit fb06141

Please sign in to comment.