NOTICE! This is a static HTML version of a legacy ImageJ Trac ticket.

The ImageJ project now uses GitHub Issues for issue tracking.

Please file all new issues there.

Ticket #511 (closed defect: fixed)

Opened 2011-05-10T17:33:07-05:00

Last modified 2011-05-19T15:43:24-05:00

Image window sometimes does not resize upon dimension change

Reported by: bdezonia Owned by: bdezonia
Priority: major Milestone: biweekly-2011: May-09 to May-20
Component: Display API Version:
Severity: serious Keywords:
Cc: Blocked By:
Blocking:

Description

Code to repack the image window is now in place. And if you run crop or rotate 90 it works under special circumstances. (in fact it is written to work in the general case).

basically if you load an image and then rotate or crop it the window is not resized correctly. However if you first slightly change the window size then every rotation and crop afterwards works correctly. there is some initialization code that must not be getting run. please find and fix.

(note that this issue has been around for quite some time)

Change History

comment:1 Changed 2011-05-11T14:42:21-05:00 by bdezonia

There is a point where the correct code will fix this in SwingDisplayWindow::redoLayout(). Just before the pack() we need to call this.setPreferredSize(). It is difficult to know what the correct values are here but testing with hard coded values shows that this will fix the bug.

comment:2 Changed 2011-05-19T11:41:48-05:00 by bdezonia

Cannot fix this at the moment. Bug #518 now rears it's head before this one can happen.

comment:3 Changed 2011-05-19T15:43:24-05:00 by bdezonia

  • Status changed from new to closed
  • Resolution set to fixed

As of 4db5647609829d3e9bad8bee379a36ce582e1a00 (sometime after replacement of SwingImageCanvas with JHotDrawImageCanvas) this is no longer a problem. There are other issues that I will report in a different ticket.