Integration (with myself) fixes

- Adding default value in empty frames to avoid artifact when paint
bucketing (you may have issues with previously stored model before this
commit, no migration plan for papybrossette :D)
 - Fix issue: Model does not show up when loading a remote GAE model
 - Removing FRAMESHEET_UPDATED events (remains of history manager
implementation)
This commit is contained in:
Vince
2012-09-03 20:45:25 +02:00
parent c6d338507e
commit 2a20cc90ea
9 changed files with 45 additions and 43 deletions

View File

@ -21,8 +21,10 @@
context.clearRect(col * dpi, row * dpi, dpi, dpi);
}
else {
// TODO(vincz): Found a better design to update the palette, it's called too frequently.
$.publish(Events.COLOR_USED, [color]);
if(color != Constants.SELECTION_TRANSPARENT_COLOR) {
// TODO(vincz): Found a better design to update the palette, it's called too frequently.
$.publish(Events.COLOR_USED, [color]);
}
context.fillStyle = color;
context.fillRect(col * dpi, row * dpi, dpi, dpi);
}

View File

@ -32,10 +32,4 @@
ns.Eraser.prototype.moveToolAt = function(col, row, frame, color, canvas, dpi) {
this.applyToolAt(col, row, frame, color, canvas, dpi);
};
ns.Eraser.prototype.releaseToolAt = function(col, row, frame, color, canvas, dpi) {
// TODO: Create a afterRelease event hook or put that deep in the model
$.publish(Events.FRAMESHEET_UPDATED);
};
})();

View File

@ -21,18 +21,12 @@
var targetColor = pskl.utils.normalizeColor(frame[col][row]);
//this.recursiveFloodFill_(frame, col, row, targetColor, color);
this.queueLinearFloodFill_(frame, col, row, targetColor, color);
$.publish(Events.FRAMESHEET_UPDATED);
// Draw in canvas:
// TODO: Remove that when we have the centralized redraw loop
this.drawFrameInCanvas(frame, canvas, dpi);
};
ns.PaintBucket.prototype.releaseToolAt = function(col, row, frame, color, canvas, dpi) {
// TODO: Create a afterRelease event hook or put that deep in the model
$.publish(Events.FRAMESHEET_UPDATED);
};
/**
* Flood-fill (node, target-color, replacement-color):
* 1. Set Q to the empty queue.

View File

@ -49,7 +49,7 @@
for(var i = 0; i< strokePoints.length; i++) {
if(color == Constants.TRANSPARENT_COLOR) {
color = "rgba(255, 255, 255, 0.6)";
color = Constants.SELECTION_TRANSPARENT_COLOR;
}
this.drawPixelInCanvas(strokePoints[i].col, strokePoints[i].row, this.canvasOverlay, color, dpi);
}
@ -84,9 +84,6 @@
// For now, we are done with the stroke tool and don't need an overlay anymore:
this.removeCanvasOverlays();
// TODO: Create a afterRelease event hook or put that deep in the model
$.publish(Events.FRAMESHEET_UPDATED);
};
/**

View File

@ -52,9 +52,4 @@
this.previousCol = col;
this.previousRow = row;
};
ns.SimplePen.prototype.releaseToolAt = function(col, row, frame, color, canvas, dpi) {
// TODO: Create a afterRelease event hook or out that deep in the model
$.publish(Events.FRAMESHEET_UPDATED);
};
})();

View File

@ -62,7 +62,7 @@
// We set it to a semi-opaque white during the tool mousemove allowing to see colors below the stroke.
// When the stroke tool will be released, It will draw a transparent stroke,
// eg deleting the equivalent of a stroke.
color = "rgba(255, 255, 255, 0.6)";
color = Constants.SELECTION_TRANSPARENT_COLOR;
}
this.drawPixelInCanvas(strokePoints[i].col, strokePoints[i].row, this.canvasOverlay, color, dpi);
}
@ -96,10 +96,7 @@
}
// For now, we are done with the stroke tool and don't need an overlay anymore:
this.removeCanvasOverlays();
// TODO: Create a afterRelease event hook or out that deep in the model
$.publish(Events.FRAMESHEET_UPDATED);
this.removeCanvasOverlays();
};
})();