GNOME Bugzilla – Bug 622508
Magnifier DBus setCrosswireColor() doesn't convert correctly to hex string
Last modified: 2013-12-04 18:03:25 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.
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.
*** Bug 621327 has been marked as a duplicate of this bug. ***
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)
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 on attachment 164628 [details] [review] Magnifier DBus setCrosswireColor() doesn't convert correctly to hex string. Looks good, thanks!
Pushed