FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Error markers stay next to lines in short sketches · mplee/processing@bf9d6d8 · GitHub

Repository navigation

Commit bf9d6d8

Browse files
committed
Error markers stay next to lines in short sketches
1 parent d7f71ab commit bf9d6d8

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎java/src/processing/mode/java/MarkerColumn.java‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
import processing.app.Sketch;
4040
import processing.app.SketchCode;
4141
import processing.app.Util;
42+
import processing.core.PApplet;
4243
import processing.mode.java.pdex.LineMarker;
4344
import processing.mode.java.pdex.Problem;
4445
import processing.app.Language;
@@ -205,12 +206,15 @@ private void recalculateMarkerPositions() {
205206
e.printStackTrace();
206207
totalLines = 1; // do not divide by zero
207208
}
209+
int visibleLines = editor.getTextArea().getVisibleLines();
210+
totalLines = PApplet.max(totalLines, visibleLines);
208211

209212
for (LineMarker m : errorPoints) {
210213
// Ratio of error line to total lines
211214
float y = (m.getLineNumber() + 1) / ((float) totalLines);
212215
// Ratio multiplied by height of the error bar
213-
y *= getHeight() - 15; // -15 is just a vertical offset
216+
y *= getHeight();
217+
y -= 15; // -15 is just a vertical offset
214218

215219
m.setY((int) y);
216220
}

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL