ImageViewer icon indicating copy to clipboard operation
ImageViewer copied to clipboard

refund goes to current RulerMetaDataFactory

Open brad-t-moore opened this issue 1 year ago • 0 comments

There is a design / bug with the current multi-ruler type implementation. When using more than one type of ruler (e.g. Rainbow and ONSD), you can mess up the workflow when you interact with a type of ruler that isn't the active type. For example, setup a workflow with ONSD ruler, then Rainbow ruler. Make an ONSD ruler. Switch to Rainbow ruler. Make a Rainbow ruler. Now delete the ONSD ruler. The ONSD ruler with be "refund()"ed on to the Rainbow meta data factory. So even though you are on the Rainbow ruler workflow step, the next clicks will make the ONSD ruler.

Possible fix is to move refund() from the meta data factory to a method on the RulerTool instance and have it callback to the appropriate meta data factory (not the currently selected). Or disallow interacting with RulerTool instances that don't match the active type.

brad-t-moore avatar May 09 '23 15:05 brad-t-moore