diff options
author | Martin Wimpress <[email protected]> | 2015-09-24 17:59:01 +0100 |
---|---|---|
committer | Martin Wimpress <[email protected]> | 2015-09-24 17:59:01 +0100 |
commit | 5a5236d833230939333fb9a66422e88e40f0f54d (patch) | |
tree | 27d081e626c68e65fdcc0aec7d4d7e8579bebbde /src/ui/tile-preview.c | |
parent | 1bb2f34586f78697713e38681402f7099bc87078 (diff) | |
parent | 77e1f5059cea5d0cf027086d9536f207ca95ccda (diff) | |
download | marco-5a5236d833230939333fb9a66422e88e40f0f54d.tar.bz2 marco-5a5236d833230939333fb9a66422e88e40f0f54d.tar.xz |
Merge pull request #223 from dnk/tile_border
gtk3: draw tile border
Diffstat (limited to 'src/ui/tile-preview.c')
-rw-r--r-- | src/ui/tile-preview.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/ui/tile-preview.c b/src/ui/tile-preview.c index 6682de69..e14ffe25 100644 --- a/src/ui/tile-preview.c +++ b/src/ui/tile-preview.c @@ -69,13 +69,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, @@ -89,7 +85,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 @@ -117,6 +113,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) |