After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 622508 - Magnifier DBus setCrosswireColor() doesn't convert correctly to hex string
Magnifier DBus setCrosswireColor() doesn't convert correctly to hex string
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: magnifier
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
: 621327 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-06-23 16:50 UTC by Joseph Scheuhammer
Modified: 2013-12-04 18:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix for bgo#622508 - Magnifier DBus setCrosswireColor() doesn't convert correctly to hex string. (1.25 KB, patch)
2010-06-23 16:57 UTC, Joseph Scheuhammer
reviewed Details | Review
Magnifier DBus setCrosswireColor() doesn't convert correctly to hex string. (986 bytes, patch)
2010-06-25 14:57 UTC, Joseph Scheuhammer
accepted-commit_now Details | Review

Description Joseph Scheuhammer 2010-06-23 16:50:07 UTC
With respect to magnifierDBus.js:  The setCrosswireColor() method takes an integer as its parameter and converts that to a hex string.  The integer is in the form 'rrggbbaa'.

If the significant bits are zero, the hex string does not include them.  For example, blue is 0x0000ffff, and is converted to the hex string "ffff" instead of the desired "0000ffff".  The colour of the crosshairs is thereby wrongly set to a yellow-ish, almost transparent colour, and not blue.
Comment 1 Joseph Scheuhammer 2010-06-23 16:57:25 UTC
Created attachment 164415 [details] [review]
Fix for bgo#622508 - Magnifier DBus setCrosswireColor() doesn't convert correctly to hex string.

Modified setCrosswireColor() in magnifierDBus.js to correctly prepend "0" when
converting from integer with leading zeros to hex string.
Comment 2 Joanmarie Diggs (IRC: joanie) 2010-06-23 20:49:54 UTC
*** Bug 621327 has been marked as a duplicate of this bug. ***
Comment 3 Florian Müllner 2010-06-24 13:59:52 UTC
Review of attachment 164415 [details] [review]:

::: js/ui/magnifierDBus.js
@@ -268,3 @@
      setCrosswireColor: function(color) {
      */
-        Main.magnifier.setCrosshairsColor('#' + color.toString(16));

I just pushed a changed to misc.format which allows you to use the usual printf style formatting like this:
'#%08x'.format(color)
Comment 4 Joseph Scheuhammer 2010-06-25 14:57:39 UTC
Created attachment 164628 [details] [review]
Magnifier DBus setCrosswireColor() doesn't convert correctly to hex string.

Modified setCrosswireColor() in magnifierDBus.js to correctly pad hex string
with leading zeroes when converting from integer.
Comment 5 Florian Müllner 2010-06-25 15:37:18 UTC
Comment on attachment 164628 [details] [review]
Magnifier DBus setCrosswireColor() doesn't convert correctly to hex string.

Looks good, thanks!
Comment 6 Owen Taylor 2010-06-25 20:43:03 UTC
Pushed