Skip to content

Commit

Permalink
Fix the render-task displaying the wrong time after being paused or/a…
Browse files Browse the repository at this point in the history
…nd saved
  • Loading branch information
TBlueF committed Nov 15, 2019
1 parent fafc5c4 commit 7b9fbdf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ public Collection<RenderTicket> createTickets(MapType mapType, Collection<Vector
public boolean prioritizeRenderTask(RenderTask renderTask) {
synchronized (renderTasks) {
if (renderTasks.remove(renderTask)) {

//pause first task
RenderTask currentFirst = renderTasks.peek();
if (currentFirst != null) currentFirst.pause();

renderTasks.addFirst(renderTask);
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ public RenderTicket poll() {
* It will resume as soon as a new ticket gets polled
*/
public void pause() {
if (firstTileTime < 0) return;

synchronized (renderTiles) {
additionalRunTime += System.currentTimeMillis() - firstTileTime;
firstTileTime = -1;
Expand Down

0 comments on commit 7b9fbdf

Please sign in to comment.