[gtk/wip/otte/for-main: 2/2] rgba: Fix GDK_RGBA() macro to work with alpha
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/otte/for-main: 2/2] rgba: Fix GDK_RGBA() macro to work with alpha
- Date: Tue, 8 Feb 2022 00:35:06 +0000 (UTC)
commit f37c5ebd267c625001e6c67b6d5bf46338524ae0
Author: Benjamin Otte <otte redhat com>
Date: Sun Feb 6 20:01:49 2022 +0100
rgba: Fix GDK_RGBA() macro to work with alpha
Previously we dividied by an integer, so alpha was either 0.0 or 1.0.
gdk/gdkrgbaprivate.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gdk/gdkrgbaprivate.h b/gdk/gdkrgbaprivate.h
index fc355f5913..7701479bcc 100644
--- a/gdk/gdkrgbaprivate.h
+++ b/gdk/gdkrgbaprivate.h
@@ -33,7 +33,7 @@
((_GDK_RGBA_SELECT_COLOR(str, 0, 0) << 4) | _GDK_RGBA_SELECT_COLOR(str, 0, 1)) / 255., \
((_GDK_RGBA_SELECT_COLOR(str, 1, 2) << 4) | _GDK_RGBA_SELECT_COLOR(str, 1, 3)) / 255., \
((_GDK_RGBA_SELECT_COLOR(str, 2, 4) << 4) | _GDK_RGBA_SELECT_COLOR(str, 2, 5)) / 255., \
- ((sizeof(str) % 4 == 1) ? ((_GDK_RGBA_SELECT_COLOR(str, 3, 6) << 4) | _GDK_RGBA_SELECT_COLOR(str, 3, 7))
: 0xFF) / 255 })
+ ((sizeof(str) % 4 == 1) ? ((_GDK_RGBA_SELECT_COLOR(str, 3, 6) << 4) | _GDK_RGBA_SELECT_COLOR(str, 3, 7))
: 0xFF) / 255. })
gboolean gdk_rgba_parser_parse (GtkCssParser *parser,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]