diff --git a/pdex/src/processing/mode/experimental/ErrorBar.java b/pdex/src/processing/mode/experimental/ErrorBar.java index b858dcdbb..037f98d83 100755 --- a/pdex/src/processing/mode/experimental/ErrorBar.java +++ b/pdex/src/processing/mode/experimental/ErrorBar.java @@ -149,7 +149,8 @@ public class ErrorBar extends JPanel { // NOTE TO SELF: ErrorMarkers are calculated for the present tab only // Error Marker index in the arraylist is LOCALIZED for current tab. - // Also, need to do the update in the UI thread to prevent concurrency issues. + // Also, need to do the update in the UI thread via SwingWorker to prevent + // concurrency issues. final int fheight = this.getHeight(); SwingWorker worker = new SwingWorker() { @@ -178,7 +179,7 @@ public class ErrorBar extends JPanel { for (Problem problem : problems) { if (problem.getTabIndex() == currentTab) { // Ratio of error line to total lines - float y = (problem.getLineNumber() - errorCheckerService.defaultImportsOffset) + float y = (problem.getLineNumber() + 1) / ((float) totalLines); // Ratio multiplied by height of the error bar y *= fheight - 15; // -15 is just a vertical offset