background: Keep the state of key frame files on Animation
This gets us from a mix of pure getters and class state to just class state. https://bugzilla.gnome.org/show_bug.cgi?id=695882
This commit is contained in:
parent
b351536dee
commit
3a27d0b849
@ -384,7 +384,8 @@ const Background = new Lang.Class({
|
|||||||
_updateAnimation: function() {
|
_updateAnimation: function() {
|
||||||
this._updateAnimationTimeoutId = 0;
|
this._updateAnimationTimeoutId = 0;
|
||||||
|
|
||||||
let files = this._animation.getKeyFrameFiles(this._layoutManager.monitors[this._monitorIndex]);
|
this._animation.update(this._layoutManager.monitors[this._monitorIndex]);
|
||||||
|
let files = this._animation.keyFrameFiles;
|
||||||
|
|
||||||
if (!files) {
|
if (!files) {
|
||||||
this._setLoaded();
|
this._setLoaded();
|
||||||
@ -589,7 +590,7 @@ const Animation = new Lang.Class({
|
|||||||
params = Params.parse(params, { filename: null });
|
params = Params.parse(params, { filename: null });
|
||||||
|
|
||||||
this.filename = params.filename;
|
this.filename = params.filename;
|
||||||
this._keyFrames = [];
|
this.keyFrameFiles = [];
|
||||||
this.duration = 0.0;
|
this.duration = 0.0;
|
||||||
this.transitionProgress = 0.0;
|
this.transitionProgress = 0.0;
|
||||||
this.loaded = false;
|
this.loaded = false;
|
||||||
@ -610,26 +611,24 @@ const Animation = new Lang.Class({
|
|||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
|
|
||||||
getKeyFrameFiles: function(monitor) {
|
update: function(monitor) {
|
||||||
|
this.keyFrameFiles = [];
|
||||||
|
|
||||||
if (!this._show)
|
if (!this._show)
|
||||||
return null;
|
return;
|
||||||
|
|
||||||
if (this._show.get_num_slides() < 1)
|
if (this._show.get_num_slides() < 1)
|
||||||
return null;
|
return;
|
||||||
|
|
||||||
let [progress, duration, isFixed, file1, file2] = this._show.get_current_slide(monitor.width, monitor.height);
|
let [progress, duration, isFixed, file1, file2] = this._show.get_current_slide(monitor.width, monitor.height);
|
||||||
|
|
||||||
this.transitionProgress = progress;
|
this.transitionProgress = progress;
|
||||||
|
|
||||||
let files = [];
|
|
||||||
|
|
||||||
if (file1)
|
if (file1)
|
||||||
files.push(file1);
|
this.keyFrameFiles.push(file1);
|
||||||
|
|
||||||
if (file2)
|
if (file2)
|
||||||
files.push(file2);
|
this.keyFrameFiles.push(file2);
|
||||||
|
|
||||||
return files;
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
Signals.addSignalMethods(Animation.prototype);
|
Signals.addSignalMethods(Animation.prototype);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user