[gimp/gimp-2-8] libgimpwidgets: return an opaque color from gimp_pick_button_pick()'s OSX code
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gimp-2-8] libgimpwidgets: return an opaque color from gimp_pick_button_pick()'s OSX code
- Date: Fri, 11 Oct 2013 20:54:59 +0000 (UTC)
commit b8f05cdb5565c9bbf1d4836ed342315fde0c8f44
Author: Michael Natterer <mitch gimp org>
Date: Fri Oct 11 22:52:38 2013 +0200
libgimpwidgets: return an opaque color from gimp_pick_button_pick()'s OSX code
and fiddle with whitespace a bit.
(cherry picked from commit 5466caa0646ad8da028d189088ed3b21f48ecc3f)
libgimpwidgets/gimppickbutton.c | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/libgimpwidgets/gimppickbutton.c b/libgimpwidgets/gimppickbutton.c
index 12bcdef..84b188c 100644
--- a/libgimpwidgets/gimppickbutton.c
+++ b/libgimpwidgets/gimppickbutton.c
@@ -367,7 +367,8 @@ gimp_pick_button_pick (GdkScreen *screen,
gint y_root,
GimpPickButton *button)
{
- #ifndef GDK_WINDOWING_QUARTZ
+#ifndef GDK_WINDOWING_QUARTZ
+
GdkWindow *root_window = gdk_screen_get_root_window (screen);
cairo_surface_t *image;
cairo_t *cr;
@@ -391,7 +392,8 @@ gimp_pick_button_pick (GdkScreen *screen,
gimp_rgba_set_uchar (&rgb, color[0], color[1], color[2], 1.0);
- #else /* GDK_WINDOWING_QUARTZ */
+#else /* GDK_WINDOWING_QUARTZ */
+
CGImageRef root_image_ref;
CFDataRef pixel_data;
const guchar *data;
@@ -405,11 +407,12 @@ gimp_pick_button_pick (GdkScreen *screen,
pixel_data = CGDataProviderCopyData(CGImageGetDataProvider(root_image_ref));
data = CFDataGetBytePtr(pixel_data);
- gimp_rgba_set_uchar (&rgb, data[2], data[1], data[0], 1.0);
+ gimp_rgba_set_uchar (&rgb, data[2], data[1], data[0], 255);
CGImageRelease (root_image_ref);
CFRelease (pixel_data);
- #endif /* GDK_WINDOWING_QUARTZ */
+
+#endif /* GDK_WINDOWING_QUARTZ */
g_signal_emit (button, pick_button_signals[COLOR_PICKED], 0, &rgb);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]