Fix jscolor : add jscolor.install to Palette Controller init sequence. Fix layer canvas update on DPI change

This commit is contained in:
jdescottes 2013-09-26 22:43:45 +02:00
parent 50ca22d91a
commit 1bc73125dc
5 changed files with 12 additions and 6 deletions

View File

@ -333,6 +333,10 @@
this.overlayRenderer.updateDPI(dpi);
this.renderer.updateDPI(dpi);
this.layersUpRenderer.updateDPI(dpi);
this.layersDownRenderer.updateDPI(dpi);
this.serializedLayerFrame ="";
var currentFrameHeight = this.piskelController.getCurrentFrame().getHeight();
var canvasHeight = currentFrameHeight * dpi;
if (pskl.UserSettings.get(pskl.UserSettings.SHOW_GRID)) {

View File

@ -28,6 +28,7 @@
secondaryColorPicker.val(Constants.TRANSPARENT_COLOR);
secondaryColorPicker.change({isPrimary : false}, $.proxy(this.onPickerChange_, this));
window.jscolor.install();
};
/**

View File

@ -10,7 +10,7 @@
this.currentLayerIndex = 0;
this.currentFrameIndex = 0;
this.layerIdCounter = 0;
this.layerIdCounter = 1;
$.publish(Events.FRAMESHEET_RESET);
$.publish(Events.FRAME_SIZE_CHANGED);

View File

@ -20,7 +20,11 @@ var jscolor = {
install : function() {
jscolor.addEvent(window, 'load', jscolor.init);
if (document.readyState === "complete") {
jscolor.init();
} else {
jscolor.addEvent(window, 'load', jscolor.init);
}
},
@ -921,6 +925,3 @@ var jscolor = {
}
};
jscolor.install();

View File

@ -66,7 +66,7 @@
ns.FrameRenderer.prototype.render = function (frame) {
if (frame) {
this.clear(frame);
this.clear();
var context = this.getCanvas_(frame).getContext('2d');
for(var col = 0, width = frame.getWidth(); col < width; col++) {
for(var row = 0, height = frame.getHeight(); row < height; row++) {