(int pos)
| 885 | |
| 886 | // workaround for TextArea.getCaretPosition() bug on Windows |
| 887 | private int offset(int pos) { |
| 888 | if (!IJ.isWindows()) |
| 889 | return 0; |
| 890 | String text = ta.getText(); |
| 891 | int rcount = 0; |
| 892 | for (int i=0; i<=pos; i++) { |
| 893 | if (text.charAt(i)=='\r') |
| 894 | rcount++; |
| 895 | } |
| 896 | if (IJ.debugMode) IJ.log("offset: "+pos+" "+rcount); |
| 897 | return pos-rcount>=0?rcount:0; |
| 898 | } |
| 899 | |
| 900 | void copyToInfo() { |
| 901 | ImagePlus imp = WindowManager.getCurrentImage(); |