Skip to content

Commit

Permalink
2023.04.11 (1.54e11; Scale bar)
Browse files Browse the repository at this point in the history
  • Loading branch information
rasband committed Apr 12, 2023
1 parent 6b7ee85 commit 559646b
Show file tree
Hide file tree
Showing 9 changed files with 156 additions and 69 deletions.
2 changes: 1 addition & 1 deletion ij/ImageJ.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public class ImageJ extends Frame implements ActionListener,

/** Plugins should call IJ.getVersion() or IJ.getFullVersion() to get the version string. */
public static final String VERSION = "1.54e";
public static final String BUILD = "8";
public static final String BUILD = "11";
public static Color backgroundColor = new Color(237,237,237);
/** SansSerif, 12-point, plain font. */
public static final Font SansSerif12 = new Font("SansSerif", Font.PLAIN, 12);
Expand Down
1 change: 1 addition & 0 deletions ij/Menus.java
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ public static Menu getExamplesMenu(ActionListener listener) {
addExample(submenu, "Curve Fitting", "Curve_Fitting.ijm");
addExample(submenu, "Colors of 2021", "Colors_of_2021.ijm");
addExample(submenu, "Turtle Graphics", "Turtle_Graphics.ijm");
addExample(submenu, "Easter Eggs", "Easter_Eggs.ijm");
submenu.addActionListener(listener);
menu.add(submenu);

Expand Down
2 changes: 1 addition & 1 deletion ij/gui/PolygonRoi.java
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ private void drawSpline(Graphics g, float[] xpoints, float[] ypoints, int npoint
boolean doScaling = ic!=null; //quicker drawing if we don't need to convert to screen coordinates
if (ic!=null) {
Rectangle srcRect = ic.getSrcRect();
if (srcRect!=null && srcRect.x == 0 && srcRect.y == 0 && ic.getMagnification()==1.0)
if (srcRect!=null && srcRect.x == 0 && srcRect.y == 0 && ic!=null && ic.getMagnification()==1.0)
doScaling = false;
}
double xd = getXBase();
Expand Down
10 changes: 6 additions & 4 deletions ij/gui/Roi.java
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,9 @@ public synchronized Object clone() {
r.setImage(null);
if (!usingDefaultStroke)
r.setStroke(getStroke());
Color strokeColor2 = getStrokeColor();
r.setFillColor(getFillColor());
r.setStrokeColor(strokeColor2);
r.imageID = getImageID();
r.listenersNotified = false;
if (bounds!=null)
Expand Down Expand Up @@ -2441,17 +2443,17 @@ protected static boolean magnificationForSubPixel(double magnification) {
/**Converts an image pixel x (offscreen)coordinate to a screen x coordinate,
* taking the the line or area convention for coordinates into account */
protected int screenXD(double ox) {
if (ic == null) return (int)ox;
if (ic==null) return (int)ox;
if (useLineSubpixelConvention()) ox += 0.5;
return ic.screenXD(ox);
return ic!=null?ic.screenXD(ox):(int)ox;
}

/**Converts an image pixel y (offscreen)coordinate to a screen y coordinate,
* taking the the line or area convention for coordinates into account */
protected int screenYD(double oy) {
if (ic == null) return (int)oy;
if (ic==null) return (int)oy;
if (useLineSubpixelConvention()) oy += 0.5;
return ic.screenYD(oy);
return ic!=null?ic.screenYD(oy):(int)oy;
}

protected int screenX(int ox) {return screenXD(ox);}
Expand Down
7 changes: 6 additions & 1 deletion ij/gui/ShapeRoi.java
Original file line number Diff line number Diff line change
Expand Up @@ -957,8 +957,13 @@ public void draw(Graphics g) {
if (isActiveOverlayRoi) {
g2d.setColor(Color.cyan);
g2d.draw(aTx.createTransformedShape(shape));
} else
} else {
g2d.fill(aTx.createTransformedShape(shape));
if (strokeColor!=null) {
g.setColor(strokeColor);
g2d.draw(aTx.createTransformedShape(shape));
}
}
} else
g2d.draw(aTx.createTransformedShape(shape));
if (stroke!=null) g2d.setStroke(defaultStroke);
Expand Down
10 changes: 5 additions & 5 deletions ij/io/RoiDecoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -421,16 +421,16 @@ void getStrokeWidthAndColor(Roi roi, int hdr2Offset, boolean scaleStrokeWidth) {
else
roi.setUnscalableStrokeWidth(strokeWidth);
}
int strokeColor = getInt(STROKE_COLOR);
if (strokeColor!=0) {
int alpha = (strokeColor>>24)&0xff;
roi.setStrokeColor(new Color(strokeColor, alpha!=255));
}
int fillColor = getInt(FILL_COLOR);
if (fillColor!=0) {
int alpha = (fillColor>>24)&0xff;
roi.setFillColor(new Color(fillColor, alpha!=255));
}
int strokeColor = getInt(STROKE_COLOR);
if (strokeColor!=0) {
int alpha = (strokeColor>>24)&0xff;
roi.setStrokeColor(new Color(strokeColor, alpha!=255));
}
}

public Roi getShapeRoi() throws IOException {
Expand Down
2 changes: 0 additions & 2 deletions ij/macro/Functions.java
Original file line number Diff line number Diff line change
Expand Up @@ -4708,8 +4708,6 @@ else if (arg1.equals("stack position"))
Analyzer.setMeasurement(STACK_POSITION, state);
else if (arg1.startsWith("std"))
Analyzer.setMeasurement(STD_DEV, state);
else if (arg1.equals("showrownumbers"))
ResultsTable.getResultsTable().showRowNumbers(state);
else if (arg1.equals("showrowindexes"))
ResultsTable.getResultsTable().showRowIndexes(state);
else if (arg1.startsWith("show"))
Expand Down
Loading

0 comments on commit 559646b

Please sign in to comment.