Permalink
Browse files

2018.07.09 (1.52e57)

  • Loading branch information...
rasband committed Jul 10, 2018
1 parent 0af213b commit 68e7e9535f33c3891b1e1025c05c210039563288
Showing with 33 additions and 16 deletions.
  1. +1 −1 ij/ImageJ.java
  2. +8 −1 ij/io/RoiEncoder.java
  3. +21 −13 ij/plugin/frame/Editor.java
  4. +3 −1 release-notes.html
View
@@ -79,7 +79,7 @@ Runs a macro or script (JavaScript, BeanShell or Python) in
/** Plugins should call IJ.getVersion() or IJ.getFullVersion() to get the version string. */
public static final String VERSION = "1.52e";
public static final String BUILD = "47";
public static final String BUILD = ""; //57
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);
View
@@ -169,8 +169,15 @@ void write(Roi roi, OutputStream f) throws IOException {
}
}
if (n>65535) {
if (type==polygon || type==freehand || type==traced) {
String name = roi.getName();
roi = new ShapeRoi(roi);
if (name!=null) roi.setName(name);
saveShapeRoi(roi, rect, f, options);
return;
}
ij.IJ.beep();
ij.IJ.log("ROIs with more than 65k points cannot be saved.");
ij.IJ.log("Non-area selections with more than 65k points cannot be saved.");
n = 65535;
}
putShort(RoiDecoder.N_COORDINATES, n);
@@ -133,21 +133,24 @@ void addMenuBar(int options) {
mb.add(m);
m = new Menu("Edit");
MenuItem item = new MenuItem("Undo",new MenuShortcut(KeyEvent.VK_Z));
MenuItem item = null;
if (IJ.isWindows())
item = new MenuItem("Undo Ctrl+Z");
else
item = new MenuItem("Undo",new MenuShortcut(KeyEvent.VK_Z));
m.add(item);
m.addSeparator();
boolean shortcutsBroken = IJ.isWindows();
if (shortcutsBroken)
if (IJ.isWindows())
item = new MenuItem("Cut Ctrl+X");
else
item = new MenuItem("Cut",new MenuShortcut(KeyEvent.VK_X));
m.add(item);
if (shortcutsBroken)
if (IJ.isWindows())
item = new MenuItem("Copy Ctrl+C");
else
item = new MenuItem("Copy", new MenuShortcut(KeyEvent.VK_C));
m.add(item);
if (shortcutsBroken)
if (IJ.isWindows())
item = new MenuItem("Paste Ctrl+V");
else
item = new MenuItem("Paste",new MenuShortcut(KeyEvent.VK_V));
@@ -608,6 +611,10 @@ String detabLine(String s) {
}
void undo() {
if (IJ.isWindows()) {
IJ.showMessage("Editor", "Press Ctrl-Z to undo");
return;
}
if (IJ.debugMode) IJ.log("Undo1: "+undoBuffer.size());
int position = ta.getCaretPosition();
if (undoBuffer.size()>1) {
@@ -616,7 +623,7 @@ void undo() {
performingUndo = true;
ta.setText(text);
if (position<=text.length())
ta.setCaretPosition(position);
ta.setCaretPosition(position-offset(position));
if (IJ.debugMode) IJ.log("Undo2: "+undoBuffer.size()+" "+text);
}
}
@@ -637,7 +644,7 @@ void cut() {
if (copy()) {
int start = ta.getSelectionStart();
int end = ta.getSelectionEnd();
ta.replaceRange("", start-offset(start), end-offset(start));
ta.replaceRange("", start-offset(start), end-offset(end-2>=start?end-2:start));
if (IJ.isMacOSX())
ta.setCaretPosition(start);
}
@@ -655,14 +662,14 @@ void paste() {
}
int start = ta.getSelectionStart( );
int end = ta.getSelectionEnd( );
ta.replaceRange(s, start-offset(start), end-offset(start));
ta.replaceRange(s, start-offset(start), end-offset(end-2>=start?end-2:start));
if (IJ.isMacOSX())
ta.setCaretPosition(start+s.length());
checkForCurlyQuotes = true;
}
// workaround for WIndows bug
private int offset(int pos) {
// workaround for TextArea.getCaretPosition() bug on WIndows
private int offset(int pos) {
if (!IJ.isWindows())
return 0;
String text = ta.getText();
@@ -744,7 +751,7 @@ else if ("Revert".equals(what))
revert();
else if ("Print...".equals(what))
print();
else if (what.equals("Undo"))
else if (what.startsWith("Undo"))
undo();
else if (what.startsWith("Paste"))
paste();
@@ -1442,11 +1449,12 @@ public static String getJSPrefix(String arg) {
return JavaScriptIncludes+"function getArgument() {return \""+arg+"\";};";
}
/** Changes Mac OS 9 (CR) and Windows (CRLF) line separators to line feeds (LF). */
/** Changes Windows (CRLF) line separators to line feeds (LF). */
public void fixLineEndings() {
if (!IJ.isWindows())
return;
String text = ta.getText();
text = text.replaceAll("\r\n", "\n");
text = text.replaceAll("\r", "\n");
ta.setText(text);
}
View
@@ -5,7 +5,7 @@
</head>
<body>
<li> <u>1.52e 6 July 2018</u>
<li> <u>1.52e 9 July 2018</u>
<ul>
<li> The "Threshold" tool no longer resets the display range of 16-bit and 32-bit images.
<li> Restored the "Set" button (removed in 1.51r) to the "Threshold" dialog,
@@ -41,6 +41,8 @@
to be pasted into text editor windows at the wrong position.
<li> Thanks to Stein Rorvik, fixed a bug that caused print("\n\n") to do
nothing instead of outputting two blank lines as expected.
<li> Thanks to 'mryellow', fixed a bug that caused polygonal ROIs with
more than 65,535 points to not be saved correctly.
<li> Thanks to Lorenzo Cangiano and Jan Eglinger, fixed a 1.52c regression
that caused a "Save changes?" dialog to be unexpectedly displayed when
closing an image with a multi-point selection.

0 comments on commit 68e7e95

Please sign in to comment.