screenshot: Immediately show the flash spot

The "flash" effect looks awkward when it fades in and out. Real
camera have an immediate flash of light, which then seems to fade
out as our eyes readjust the rapid change in lighting.

https://bugzilla.gnome.org/show_bug.cgi?id=691875
This commit is contained in:
Jasper St. Pierre 2013-01-14 17:51:36 -05:00
parent d497ed4040
commit 90fae00aa6

View File

@ -242,7 +242,7 @@ const SelectArea = new Lang.Class({
}); });
Signals.addSignalMethods(SelectArea.prototype); Signals.addSignalMethods(SelectArea.prototype);
const FLASHSPOT_ANIMATION_TIME = 0.25; // seconds const FLASHSPOT_ANIMATION_OUT_TIME = 0.5; // seconds
const Flashspot = new Lang.Class({ const Flashspot = new Lang.Class({
Name: 'Flashspot', Name: 'Flashspot',
@ -258,21 +258,12 @@ const Flashspot = new Lang.Class({
}, },
fire: function() { fire: function() {
this.actor.opacity = 0;
Tweener.addTween(this.actor,
{ opacity: 255,
time: FLASHSPOT_ANIMATION_TIME,
transition: 'linear',
onComplete: Lang.bind(this, this._onFireShowComplete)
});
this.actor.show(); this.actor.show();
}, this.actor.opacity = 255;
_onFireShowComplete: function() {
Tweener.addTween(this.actor, Tweener.addTween(this.actor,
{ opacity: 0, { opacity: 0,
time: FLASHSPOT_ANIMATION_TIME, time: FLASHSPOT_ANIMATION_OUT_TIME,
transition: 'linear', transition: 'easeOutQuad',
onComplete: Lang.bind(this, function() { onComplete: Lang.bind(this, function() {
this.destroy(); this.destroy();
}) })