[gimp/gtk3-port: 227/233] libgimpwidgets: Separate ruler text layer from background.
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gtk3-port: 227/233] libgimpwidgets: Separate ruler text layer from background.
- Date: Thu, 22 Sep 2016 22:39:26 +0000 (UTC)
commit bdc7dd7400d36b98c91926b0e64ee5e48bfe14df
Author: Michael Henning <drawoc darkrefraction com>
Date: Mon Sep 28 22:42:46 2015 -0400
libgimpwidgets: Separate ruler text layer from background.
Also fix failing to clear backing_store at the same time.
libgimpwidgets/gimpruler.c | 17 ++++++++++++-----
1 files changed, 12 insertions(+), 5 deletions(-)
---
diff --git a/libgimpwidgets/gimpruler.c b/libgimpwidgets/gimpruler.c
index ef9dc0c..1a35794 100644
--- a/libgimpwidgets/gimpruler.c
+++ b/libgimpwidgets/gimpruler.c
@@ -976,8 +976,14 @@ static gboolean
gimp_ruler_draw (GtkWidget *widget,
cairo_t *cr)
{
- GimpRuler *ruler = GIMP_RULER (widget);
- GimpRulerPrivate *priv = GIMP_RULER_GET_PRIVATE (ruler);
+ GimpRuler *ruler = GIMP_RULER (widget);
+ GimpRulerPrivate *priv = GIMP_RULER_GET_PRIVATE (ruler);
+ GtkStyleContext *context = gtk_widget_get_style_context (widget);
+ GtkAllocation allocation;
+
+ gtk_widget_get_allocation (widget, &allocation);
+ gtk_render_background (context, cr, 0, 0, allocation.width, allocation.height);
+ gtk_render_frame (context, cr, 0, 0, allocation.width, allocation.height);
if (! priv->backing_store_valid)
gimp_ruler_draw_ticks (ruler);
@@ -1042,8 +1048,9 @@ gimp_ruler_draw_ticks (GimpRuler *ruler)
cr = cairo_create (priv->backing_store);
- gtk_render_background (context, cr, 0, 0, allocation.width, allocation.height);
- gtk_render_frame (context, cr, 0, 0, allocation.width, allocation.height);
+ cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR);
+ cairo_paint (cr);
+ cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
gtk_style_context_get_color (context, gtk_widget_get_state_flags (widget),
&color);
@@ -1365,7 +1372,7 @@ gimp_ruler_make_pixmap (GimpRuler *ruler)
priv->backing_store =
gdk_window_create_similar_surface (gtk_widget_get_window (widget),
- CAIRO_CONTENT_COLOR,
+ CAIRO_CONTENT_COLOR_ALPHA,
allocation.width,
allocation.height);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]