error bar, old offset removed

This commit is contained in:
Manindra Moharana
2014-07-31 20:44:44 +05:30
parent 4fa5fc4ab3
commit b129b80448

View File

@@ -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<Object, Object> worker = new SwingWorker<Object, Object>() {
@@ -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