summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Gorodnichev <[email protected]>2015-09-18 18:49:54 +0300
committermonsta <[email protected]>2015-10-06 13:17:45 +0300
commitfc3b45a0cdea3544274127483137ae1eac5df53b (patch)
tree67e1c9b4834693b3428230b06a96431b60f5579d
parentab5e86cb42698d57cc72865ce97e2bdddec43beb (diff)
downloadmarco-fc3b45a0cdea3544274127483137ae1eac5df53b.tar.bz2
marco-fc3b45a0cdea3544274127483137ae1eac5df53b.tar.xz
gtk3: draw 1px tile border
-rw-r--r--src/ui/tile-preview.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/ui/tile-preview.c b/src/ui/tile-preview.c
index c938317b..e9b5178c 100644
--- a/src/ui/tile-preview.c
+++ b/src/ui/tile-preview.c
@@ -73,13 +73,9 @@ meta_tile_preview_expose (GtkWidget *widget,
if (preview->has_alpha)
{
-#if GTK_CHECK_VERSION (3, 0, 0)
- GdkRGBA preview_color = *preview->preview_color;
-#endif
-
/* Fill the preview area with a transparent color */
#if GTK_CHECK_VERSION (3, 0, 0)
- gdk_cairo_set_source_rgba (cr, &preview_color);
+ gdk_cairo_set_source_rgba (cr, preview->preview_color);
#else
cairo_set_source_rgba (cr,
(double)preview->preview_color->red / 0xFFFF,
@@ -93,7 +89,7 @@ meta_tile_preview_expose (GtkWidget *widget,
/* Use the opaque color for the border */
#if GTK_CHECK_VERSION (3, 0, 0)
- gdk_cairo_set_source_rgba (cr, &preview_color);
+ gdk_cairo_set_source_rgba (cr, preview->preview_color);
#else
gdk_cairo_set_source_color (cr, preview->preview_color);
#endif
@@ -121,6 +117,13 @@ meta_tile_preview_expose (GtkWidget *widget,
0.5, 0.5,
preview->tile_rect.width - 1,
preview->tile_rect.height - 1);
+
+#if GTK_CHECK_VERSION (3, 0, 0)
+ if (preview->has_alpha) {
+ cairo_fill_preserve (cr);
+ cairo_set_source_rgba (cr, preview->preview_color->red, preview->preview_color->green, preview->preview_color->blue, 1.0);
+ }
+#endif
cairo_stroke (cr);
#if !GTK_CHECK_VERSION (3, 0, 0)