[gtksourceview] PrintCompositor: fix syntax highlighting
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview] PrintCompositor: fix syntax highlighting
- Date: Mon, 14 Apr 2014 15:44:52 +0000 (UTC)
commit bb16be551274521952a0d9e2ff6af1c04d3a4031
Author: Sébastien Wilmet <swilmet gnome org>
Date: Mon Apr 14 17:40:39 2014 +0200
PrintCompositor: fix syntax highlighting
GdkRGBA has values between 0 and 1, and pango wants values between 0 and
65535 (like GdkColor).
https://bugzilla.gnome.org/show_bug.cgi?id=728180
gtksourceview/gtksourceprintcompositor.c | 22 ++++++++++++++++++----
1 files changed, 18 insertions(+), 4 deletions(-)
---
diff --git a/gtksourceview/gtksourceprintcompositor.c b/gtksourceview/gtksourceprintcompositor.c
index 9626c8b..9017917 100644
--- a/gtksourceview/gtksourceprintcompositor.c
+++ b/gtksourceview/gtksourceprintcompositor.c
@@ -2312,18 +2312,32 @@ get_iter_attrs (GtkSourcePrintCompositor *compositor,
if (bg_set)
{
GdkRGBA *color = NULL;
- if (bg) pango_attribute_destroy (bg);
+
+ if (bg != NULL)
+ {
+ pango_attribute_destroy (bg);
+ }
+
g_object_get (tag, "background-rgba", &color, NULL);
- bg = pango_attr_background_new (color->red, color->green, color->blue);
+ bg = pango_attr_background_new (color->red * 65535,
+ color->green * 65535,
+ color->blue * 65535);
gdk_rgba_free (color);
}
if (fg_set)
{
GdkRGBA *color = NULL;
- if (fg) pango_attribute_destroy (fg);
+
+ if (fg != NULL)
+ {
+ pango_attribute_destroy (fg);
+ }
+
g_object_get (tag, "foreground-rgba", &color, NULL);
- fg = pango_attr_foreground_new (color->red, color->green, color->blue);
+ fg = pango_attr_foreground_new (color->red * 65535,
+ color->green * 65535,
+ color->blue * 65535);
gdk_rgba_free (color);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]