Bring highlighting back.

Fix backgroundMagic using output result instead of dish value
This commit is contained in:
j433866 2019-05-07 14:20:18 +01:00
parent f1a2cf7efc
commit 35d6c7d79e
5 changed files with 86 additions and 23 deletions

View file

@ -519,6 +519,28 @@ class WorkerWaiter {
}
}
/**
* Asks the ChefWorker to calculate highlight offsets if possible.
*
* @param {Object[]} recipeConfig
* @param {string} direction
* @param {Object} pos - The position object for the highlight.
* @param {number} pos.start - The start offset.
* @param {number} pos.end - The end offset.
*/
highlight(recipeConfig, direction, pos) {
const workerIdx = this.addChefWorker();
if (workerIdx === -1) return;
this.chefWorkers[workerIdx].worker.postMessage({
action: "highlight",
data: {
recipeConfig: recipeConfig,
direction: direction,
pos: pos
}
});
}
}
export default WorkerWaiter;