Include force parameter in View#update()

Closes #675.
This commit is contained in:
Jürg Lehni 2015-04-12 15:23:24 +02:00
parent 593590d707
commit 8174405924
2 changed files with 12 additions and 5 deletions

View file

@ -109,13 +109,17 @@ var CanvasView = View.extend(/** @lends CanvasView# */{
}, },
/** /**
* Updates the view if there are changes. * Updates the view if there are changes. Note that when using built-in
* event hanlders for interaction, animation and load events, this method is
* invoked for you automatically at the end.
* *
* @function * @param {Boolean} [force=false] {@true if the view should be updated even
* if no change has happened}
* @return {Boolean} {@true if the view was updated}
*/ */
update: function() { update: function(force) {
var project = this._project; var project = this._project;
if (!project || !project._needsUpdate) if (!project || !force && !project._needsUpdate)
return false; return false;
// Initial tests conclude that clearing the canvas using clearRect // Initial tests conclude that clearing the canvas using clearRect
// is always faster than setting canvas.width = canvas.width // is always faster than setting canvas.width = canvas.width

View file

@ -457,8 +457,11 @@ var View = Base.extend(Emitter, /** @lends View# */{
* *
* @name View#update * @name View#update
* @function * @function
* @param {Boolean} [force=false] {@true if the view should be updated even
* if no change has happened}
* @return {Boolean} {@true if the view was updated}
*/ */
// update: function() { // update: function(force) {
// }, // },
/** /**