diff --git a/build.xml b/build.xml
index 046c4436c..06870bcfc 100644
--- a/build.xml
+++ b/build.xml
@@ -6,7 +6,7 @@
-
+
@@ -21,6 +21,7 @@
+
1 && isLine()) || ignoreClipRect || ((this instanceof PolygonRoi)&&((PolygonRoi)this).isSplineFit()))
imp.draw();
diff --git a/ij/gui/RoiProperties.java b/ij/gui/RoiProperties.java
index 26e37ec34..e429704cc 100644
--- a/ij/gui/RoiProperties.java
+++ b/ij/gui/RoiProperties.java
@@ -72,10 +72,12 @@ public boolean showDialog() {
boolean isText = roi instanceof TextRoi;
boolean isLine = roi.isLine();
int justification = TextRoi.LEFT;
+ double angle = 0.0;
if (isText) {
TextRoi troi = (TextRoi)roi;
Font font = troi.getCurrentFont();
strokeWidth = font.getSize();
+ angle = troi.getAngle();
justification = troi.getJustification();
}
String position = ""+roi.getPosition();
@@ -98,12 +100,16 @@ public boolean showDialog() {
gd.addStringField(nameLabel, name, 15);
gd.addStringField("Position:", position);
}
- gd.addStringField("Stroke color:", linec);
if (isText) {
- gd.addNumericField("Font size:", strokeWidth, digits);
+ gd.addStringField("Font color:", linec);
+ gd.addNumericField("Font size:", strokeWidth, digits, 4, "points");
+ digits = (int)angle==angle?0:1;
+ gd.addNumericField("Angle:", angle, digits, 4, "degrees");
gd.addChoice("Justification:", justNames, justNames[justification]);
- } else
+ } else {
+ gd.addStringField("Stroke color:", linec);
gd.addNumericField("Width:", strokeWidth, digits);
+ }
if (!isLine) {
gd.addMessage("");
gd.addStringField("Fill color:", fillc);
@@ -137,8 +143,10 @@ public boolean showDialog() {
}
linec = gd.getNextString();
strokeWidth = gd.getNextNumber();
- if (isText)
+ if (isText) {
+ angle = gd.getNextNumber();
justification = gd.getNextChoiceIndex();
+ }
if (!isLine)
fillc = gd.getNextString();
boolean applyToOverlay = false;
@@ -163,6 +171,7 @@ public boolean showDialog() {
font = new Font(font.getName(), font.getStyle(), (int)strokeWidth);
troi.setCurrentFont(font);
}
+ troi.setAngle(angle);
if (justification!=troi.getJustification())
troi.setJustification(justification);
} else
diff --git a/ij/gui/TextRoi.java b/ij/gui/TextRoi.java
index ef0f5db9c..916bc1fd4 100644
--- a/ij/gui/TextRoi.java
+++ b/ij/gui/TextRoi.java
@@ -226,17 +226,24 @@ public void draw(Graphics g) {
if (Interpreter.isBatchMode() && ic!=null && ic.getDisplayList()!=null) return;
if (newFont || width==1)
updateBounds(g);
+ Color c = getStrokeColor();
+ setStrokeColor(getColor());
super.draw(g); // draw the rectangle
+ setStrokeColor(c);
double mag = getMagnification();
int sx = screenXD(getXBase());
int sy = screenYD(getYBase());
int swidth = (int)((bounds!=null?bounds.width:width)*mag);
int sheight = (int)((bounds!=null?bounds.height:height)*mag);
Rectangle r = null;
- r = g.getClipBounds();
- g.setClip(sx, sy, swidth, sheight);
- drawText(g);
- if (r!=null) g.setClip(r.x, r.y, r.width, r.height);
+ if (angle!=0.0)
+ drawText(g);
+ else {
+ r = g.getClipBounds();
+ g.setClip(sx, sy, swidth, sheight);
+ drawText(g);
+ if (r!=null) g.setClip(r.x, r.y, r.width, r.height);
+ }
}
public void drawOverlay(Graphics g) {
diff --git a/ij/plugin/filter/Filler.java b/ij/plugin/filter/Filler.java
index ed57925e5..c30f4287c 100644
--- a/ij/plugin/filter/Filler.java
+++ b/ij/plugin/filter/Filler.java
@@ -21,6 +21,11 @@ public int setup(String arg, ImagePlus imp) {
if (imp!=null)
roi = imp.getRoi();
isTextRoi = roi!=null && (roi instanceof TextRoi);
+ if (isTextRoi && (arg.equals("draw") || arg.equals("fill")) && ((TextRoi)roi).getAngle()!=0.0) {
+ String s = IJ.isMacOSX()?"command+b":"ctrl+b";
+ IJ.error("Draw rotated text by pressing "+s+" (Image>Overlay>Add Selection).");
+ return DONE;
+ }
IJ.register(Filler.class);
int baseCapabilities = DOES_ALL+ROI_REQUIRED;
if (arg.equals("clear")) {
diff --git a/ij/plugin/frame/ThresholdAdjuster.java b/ij/plugin/frame/ThresholdAdjuster.java
index 3a1b7f4f8..95f267aae 100644
--- a/ij/plugin/frame/ThresholdAdjuster.java
+++ b/ij/plugin/frame/ThresholdAdjuster.java
@@ -455,17 +455,19 @@ void updatePercentiles(ImagePlus imp, ImageProcessor ip) {
minThresholdInt>=0 && minThresholdInt<256 && maxThresholdInt>=0 && maxThresholdInt<256) {
int[] histogram = stats.histogram;
int below = 0, inside = 0, above = 0;
+ int minValue=0, maxValue=255;
if (imp.getBitDepth()==16 && !entireStack(imp)) {
ip.setRoi(imp.getRoi());
histogram = ip.getHistogram();
minThresholdInt = (int)Math.round(ip.getMinThreshold());
maxThresholdInt = (int)Math.round(ip.getMaxThreshold());
+ minValue=(int)ip.getMin(); maxValue=(int)ip.getMax();
}
- for (int i=0; i"+maxThresholdInt+":"+above+" sum="+total);
diff --git a/release-notes.html b/release-notes.html
index ed361fb40..bebaa7947 100644
--- a/release-notes.html
+++ b/release-notes.html
@@ -5,11 +5,13 @@
- 1.48r 7 February 2014
+ 1.48r 9 February 2014
- Thanks to Michael Schmid, the Image>Adjust>Threshold widget
displays the percentile of thresholded pixels and has other improvements
(details).
+
- With text selections, the Edit>Selection>Properties dialog
+adds an "Angle:" field.
- Thanks to Michael Schmid, the Edit>Crop command is undoable.
- Thanks to Aryeh Weiss, added the RoiEncoder.save() and RoiDecoder.open() methods
(example
).
@@ -25,6 +27,8 @@
Thanks to Michael Schmid, fixed bugs that caused the ImageJ menus to disappear
on Macs when using the "Threshold", "B&C", "Channels", "CP" (Color Picker)
and "Command Finder" widgets.
+ Fixed a bug that caused the text tool to draw the text outline in the foreground
+color instead of the selection color.
Fixed a 1.48r regression that could cause Image>Adjust>Threshold
to throw an exception.