feature : add keyboard shortcuts

+ cleanup of color management
+ colors are now stored in palette controller
+ drawing controller has a dependency on palette controller
+ UPDATE COLOR events have been removed (they were used only for
synchronizing palette and drawing controller)
This commit is contained in:
jdescottes
2013-11-19 07:40:35 +01:00
parent e0b76f5329
commit a0273edb3e
5 changed files with 57 additions and 49 deletions

View File

@@ -12,7 +12,7 @@
};
pskl.utils.inherit(ns.ColorPicker, ns.BaseTool);
/**
* @override
*/
@@ -20,9 +20,9 @@
if (frame.containsPixel(col, row)) {
var sampledColor = frame.getPixel(col, row);
if (context.button == Constants.LEFT_BUTTON) {
$.publish(Events.PRIMARY_COLOR_SELECTED, [sampledColor]);
$.publish(Events.SELECT_PRIMARY_COLOR, [sampledColor]);
} else if (context.button == Constants.RIGHT_BUTTON) {
$.publish(Events.SECONDARY_COLOR_SELECTED, [sampledColor]);
$.publish(Events.SELECT_SECONDARY_COLOR, [sampledColor]);
}
}
};