Fix the render-task displaying the wrong time after being paused or/and saved

This commit is contained in:
Blue (Lukas Rieger) 2019-11-15 20:33:01 +01:00
parent fafc5c4a47
commit 7b9fbdf4ca
2 changed files with 7 additions and 0 deletions

View File

@ -94,6 +94,11 @@ public class RenderManager {
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;
}

View File

@ -104,6 +104,8 @@ public class RenderTask {
* 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;