Create an event based UserSettings and use it for the grid diplay state.

This commit is contained in:
Vince
2013-06-17 20:24:27 +02:00
parent 889d5c0d53
commit 1d4ff1d2de
5 changed files with 37 additions and 26 deletions

View File

@ -61,7 +61,7 @@
$(window).resize($.proxy(this.startDPIUpdateTimer_, this));
$.subscribe(Events.FRAME_SIZE_CHANGED, $.proxy(this.updateDPI_, this));
$.subscribe(Events.GRID_DISPLAY_STATE_CHANGED, $.proxy(this.forceRendering_, this));
$.subscribe(Events.USER_SETTINGS_CHANGED, $.proxy(this.onUserSettingsChange_, this));
};
ns.DrawingController.prototype.initMouseBehavior = function() {
@ -83,6 +83,15 @@
this.dpiUpdateTimer = window.setTimeout($.proxy(this.updateDPI_, this), 200);
},
/**
* @private
*/
ns.DrawingController.prototype.onUserSettingsChange_ = function (evt, settingsName, settingsValue) {
if(settingsName == pskl.UserSettings.SHOW_GRID) {
this.forceRendering_();
}
},
/**
* @private
*/