Skip to content
Snippets Groups Projects
Commit be339d1d authored by Nils Vreman's avatar Nils Vreman
Browse files

Fixed offset error

parent a09e0786
Branches
No related tags found
No related merge requests found
......@@ -59,9 +59,15 @@ public class TasksetDisplay extends BoxPanel implements Observer, UpdateListener
revalidate();
}
// Add empty if exists
if (empty.isPresent()) {
add(empty.get());
revalidate();
}
// This section fixes the offset from
// the lowest priority task to the Southern border.
int taskOffset = priorities.size()*35;
int taskOffset = (empty.isPresent()) ? (priorities.size() + 1)*35 : priorities.size()*35;
if (offset - taskOffset > 0) {
setMaximumSize(new Dimension(300, 35 + taskOffset));
add(createVerticalStrut(offset - taskOffset));
......@@ -70,12 +76,6 @@ public class TasksetDisplay extends BoxPanel implements Observer, UpdateListener
// Mark the previously marked one.
marked.ifPresent(taskGrid -> taskGrid.mark());
// Add empty if exists
if (empty.isPresent()) {
add(empty.get());
revalidate();
}
}
/*
......@@ -128,8 +128,7 @@ public class TasksetDisplay extends BoxPanel implements Observer, UpdateListener
emptyGrid.addEmptyListener(this);
empty = Optional.of(emptyGrid);
add(emptyGrid);
revalidate();
update(taskset, null);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment