Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] inside createTask function in mandellib.js, generation is undefined #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions chapter10/Mandel/mandel.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function startWorkers() {
for (var i = 0; i < workers.length; i++) {
var worker = workers[i];
if (worker.idle) {
var task = createTask(nextRow);
var task = createTask(nextRow, generation);
worker.idle = false;
worker.postMessage(task);
nextRow++;
Expand Down Expand Up @@ -101,7 +101,7 @@ function reassignWorker(worker) {
if (row >= canvas.height) {
worker.idle = true;
} else {
var task = createTask(row);
var task = createTask(row, generation);
worker.idle = false;
worker.postMessage(task);
}
Expand Down
2 changes: 1 addition & 1 deletion chapter10/Mandel/mandellib.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var palette = [];
//
// packages up the data we need to send to the worker
//
function createTask(row) {
function createTask(row, generation) {
var task = {
row: row, // row number we're working on
width: rowData.width, // width of the ImageData object to fill
Expand Down