From dd29914fcfe97975ce7145adc24cc556d67b83d2 Mon Sep 17 00:00:00 2001 From: Nicolas Dufour Date: Fri, 28 Feb 2014 14:56:31 +0100 Subject: Fix for Bug #1281859 (color gesture problems, alpha values below 0 and above 1). Fixed bugs: - https://launchpad.net/bugs/1281859 (bzr r13074) --- src/ui/widget/selected-style.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/ui/widget/selected-style.cpp') diff --git a/src/ui/widget/selected-style.cpp b/src/ui/widget/selected-style.cpp index d29554c41..042a6614e 100644 --- a/src/ui/widget/selected-style.cpp +++ b/src/ui/widget/selected-style.cpp @@ -1267,6 +1267,11 @@ RotateableSwatch::color_adjust(float *hsla, double by, guint32 cc, guint modifie } else if (modifier == 3) { // alpha double old = hsla[3]; hsla[3] += by/2; + if (hsla[3] < 0) { + hsla[3] = 0; + } else if (hsla[3] > 1) { + hsla[3] = 1; + } diff = hsla[3] - old; } else { // hue double old = hsla[0]; -- cgit v1.2.3