[gnome-shell] magnifier: Using properly 'color-saturation'
- From: Alejandro PiÃeiro Iglesias <apinheiro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] magnifier: Using properly 'color-saturation'
- Date: Mon, 6 Aug 2012 11:04:12 +0000 (UTC)
commit 7431c4d61126f3f91d768f6499b51abc6a1de2a3
Author: Alejandro PiÃeiro <apinheiro igalia com>
Date: Tue Jul 24 18:59:47 2012 +0200
magnifier: Using properly 'color-saturation'
As description of the setting says, color-saturation ranges from
0.0 (grayscale) to 1.0 (full color), but the real outcome was the
opposite. The reason is that clutter provides a desaturation effect,
and color-saturation was passed directly to that effect. This patch
renames the effect and compute the desaturation value.
js/ui/magnifier.js | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/js/ui/magnifier.js b/js/ui/magnifier.js
index a3813c3..f4440cd 100644
--- a/js/ui/magnifier.js
+++ b/js/ui/magnifier.js
@@ -1641,14 +1641,14 @@ const MagShaderEffects = new Lang.Class({
_init: function(uiGroupClone) {
this._inverse = new Shell.InvertLightnessEffect();
this._brightnessContrast = new Clutter.BrightnessContrastEffect();
- this._colorSaturation = new Clutter.DesaturateEffect();
+ this._colorDesaturation = new Clutter.DesaturateEffect();
this._inverse.set_enabled(false);
this._brightnessContrast.set_enabled(false);
this._magView = uiGroupClone;
this._magView.add_effect(this._inverse);
this._magView.add_effect(this._brightnessContrast);
- this._magView.add_effect(this._colorSaturation);
+ this._magView.add_effect(this._colorDesaturation);
},
/**
@@ -1659,7 +1659,7 @@ const MagShaderEffects = new Lang.Class({
*/
destroyEffects: function() {
this._magView.clear_effects();
- this._colorSaturation = null;
+ this._colorDesaturation = null;
this._brightnessContrast = null;
this._inverse = null;
this._magView = null;
@@ -1684,11 +1684,11 @@ const MagShaderEffects = new Lang.Class({
},
setColorSaturation: function(factor) {
- this._colorSaturation.set_factor(factor);
+ this._colorDesaturation.set_factor(1.0 - factor);
},
getColorSaturation: function() {
- return this._colorSaturation.get_factor();
+ return 1.0 - this._colorDesaturation.get_factor();
},
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]