| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent d7f71ab commit bf9d6d8
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -39,6 +39,7 @@ | |||
| 39 | 39 | import processing.app.Sketch; | |
| 40 | 40 | import processing.app.SketchCode; | |
| 41 | 41 | import processing.app.Util; | |
| 42 | + import processing.core.PApplet; | ||
| 42 | 43 | import processing.mode.java.pdex.LineMarker; | |
| 43 | 44 | import processing.mode.java.pdex.Problem; | |
| 44 | 45 | import processing.app.Language; | |
@@ -205,12 +206,15 @@ private void recalculateMarkerPositions() { | |||
| 205 | 206 | e.printStackTrace(); | |
| 206 | 207 | totalLines = 1; // do not divide by zero | |
| 207 | 208 | } | |
| 209 | + int visibleLines = editor.getTextArea().getVisibleLines(); | ||
| 210 | + totalLines = PApplet.max(totalLines, visibleLines); | ||
| 208 | 211 | ||
| 209 | 212 | for (LineMarker m : errorPoints) { | |
| 210 | 213 | // Ratio of error line to total lines | |
| 211 | 214 | float y = (m.getLineNumber() + 1) / ((float) totalLines); | |
| 212 | 215 | // 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 | ||
| 214 | 218 | ||
| 215 | 219 | m.setY((int) y); | |
| 216 | 220 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments