Sets the canvas size in (unscaled) pixels and sets the scale to 1.0. If the scale remains 1.0, this will be the size of the resulting ImageProcessor. When not called, the canvas size is adjusted for the plot size specified by setFrameSize() or setWindowSize(), or otherwise in Edit>Options>Plots. @se
(int width, int height)
| 526 | * @see #setWindowSize(int,int) |
| 527 | */ |
| 528 | @AstroImageJ(reason = "Scale plot size", modified = true) |
| 529 | public void setSize(int width, int height) { |
| 530 | if (ip != null && width == ip.getWidth() && height == ip.getHeight()) |
| 531 | return; |
| 532 | Dimension minSize = getMinimumSize(); |
| 533 | if (isAijPlot()) { |
| 534 | pp.width = (int) Math.round(Math.max(width, minSize.width) * Prefs.getGuiScale()); |
| 535 | pp.height = (int) Math.round(Math.max(height, minSize.height) * Prefs.getGuiScale()); |
| 536 | } else { |
| 537 | pp.width = Math.max(width, minSize.width); |
| 538 | pp.height = Math.max(height, minSize.height); |
| 539 | } |
| 540 | scale = 1.0f; |
| 541 | ip = null; |
| 542 | if (plotDrawn) updateImage(); |
| 543 | } |
| 544 | |
| 545 | /** The size of the plot including borders with axis labels etc., in pixels */ |
| 546 | public Dimension getSize() { |
no test coverage detected