MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / offset

Method offset

ij/src/main/java/ij/plugin/frame/Editor.java:887–898  ·  view source on GitHub ↗
(int pos)

Source from the content-addressed store, hash-verified

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();

Callers 3

undoMethod · 0.95
cutMethod · 0.95
pasteMethod · 0.95

Calls 4

isWindowsMethod · 0.95
logMethod · 0.95
charAtMethod · 0.80
getTextMethod · 0.45

Tested by

no test coverage detected