Remove the scalebar drawn by this plugin. If the scalebar was drawn without the overlay by another instance of the plugin (it is drawn into the image), then we cannot remove it. If the scalebar was drawn using the overlay by another instance of the plugin, then we can remove it. With or without t
()
| 85 | * drawn by this instance of the plugin. |
| 86 | */ |
| 87 | void removeScalebar() { |
| 88 | // Revert with Undo, in case "Use Overlay" is not ticked |
| 89 | imp.getProcessor().reset(); |
| 90 | imp.updateAndDraw(); |
| 91 | // Remove overlay drawn by this plugin, in case "Use Overlay" is ticked |
| 92 | Overlay overlay = imp.getOverlay(); |
| 93 | if (overlay!=null) { |
| 94 | overlay.remove(SCALE_BAR); |
| 95 | imp.draw(); |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | /** Saves the current scale bar previously drawn as an overlay by this plugin, |
| 100 | * so it can be restored later. The scale bar overlay is deleted. */ |
no test coverage detected