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 #1336 (closed defect: fixed)

Opened 2012-07-17T11:53:57-05:00

Last modified 2013-08-21T10:43:29-05:00

Drawing Tools interact with Overlays

Reported by: bdezonia Owned by: bdezonia
Priority: major Milestone: imagej2-b8-analysis
Component: Tools Version:
Severity: serious Keywords:
Cc: rob.vanthof@… Blocked By:
Blocking: #1457


In the ImageJ mailing list Rob van 't Hof reported the following issue with beta 3:

"When drawing within a selection, the selection is moved around by the drawing action."

To duplicate open boats, draw a rect overlay, select brush tool, and draw within overlay. The drawing works correctly but the overlay moves around while drawing and ends up in a new position.

Change History

comment:1 Changed 2012-07-17T16:41:39-05:00 by bdezonia

  • Blocking 1345 added

comment:2 Changed 2012-07-26T12:47:28-05:00 by bdezonia

  • Owner changed from bdezonia to dscho
  • Status changed from new to assigned

After some debugging this seems to be related to how we have a JHotDraw oriented ToolDelegator class and a IJ2 oriented DefaultToolService. Both of them deal with passing events around from tools to interested listeners but one works in Swing event space and one works in IJ2's event space. I think the events are getting handled twice. ToolDelegator says the selection tool is active and handles those events by dragging the overlay figure. At the same time I think DefaultToolService says the active tool is Pencil for instance and handles the IJ2 events by changing pixel data. Fixing might be as simple as not turning on the selection tool in the ToolDelegator in certain cases but I haven't found the correct cases when this should happen. Johannes, can you look at this a bit?

comment:3 Changed 2012-09-06T19:01:17-05:00 by dscho

  • Milestone changed from imagej-2.0.0-beta4 to imagej-2.0.0-beta5

comment:4 Changed 2012-09-07T11:02:59-05:00 by bdezonia

  • Blocking 1457 added; 1345 removed

comment:5 Changed 2012-10-10T14:00:42-05:00 by curtis

  • Milestone changed from imagej-2.0.0-beta6 to imagej-2.0.0-beta7

comment:6 Changed 2013-08-21T10:43:08-05:00 by bdezonia

  • Owner changed from dscho to bdezonia

comment:7 Changed 2013-08-21T10:43:29-05:00 by bdezonia

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

Fixed with commit beb6feaa76f2fcb09a2287e7e9d555a4486c7cea