[gthumb: 10/129] image viewer: implemented the black and white background for transparency
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb: 10/129] image viewer: implemented the black and white background for transparency
- Date: Wed, 27 Apr 2011 20:51:13 +0000 (UTC)
commit 1ec2ebd94862bccaddfd6c3fd9b3c9b54d0f0af9
Author: Paolo Bacchilega <paobac src gnome org>
Date: Thu Apr 14 19:25:58 2011 +0200
image viewer: implemented the black and white background for transparency
gthumb/gth-image-viewer.c | 30 ++++++++++++++++++++++++++++++
1 files changed, 30 insertions(+), 0 deletions(-)
---
diff --git a/gthumb/gth-image-viewer.c b/gthumb/gth-image-viewer.c
index c408321..91f9352 100644
--- a/gthumb/gth-image-viewer.c
+++ b/gthumb/gth-image-viewer.c
@@ -2603,6 +2603,36 @@ gth_image_viewer_paint_background (GthImageViewer *self,
self->image_area.y - 1 + 0.5);
cairo_stroke (cr);
}
+
+ if (TRUE /* FIXME gth_image_viewer_get_has_alpha (self) */) {
+
+ /* Draw the background for the transparency */
+
+ switch (self->priv->transp_type) {
+ case GTH_TRANSP_TYPE_BLACK:
+ cairo_set_source_rgb (cr, 0.0, 0.0, 0.0);
+ cairo_rectangle (cr,
+ self->image_area.x + 0.5,
+ self->image_area.y + 0.5,
+ self->image_area.width,
+ self->image_area.height);
+ cairo_fill (cr);
+ break;
+
+ case GTH_TRANSP_TYPE_WHITE:
+ cairo_set_source_rgb (cr, 1.0, 1.0, 1.0);
+ cairo_rectangle (cr,
+ self->image_area.x + 0.5,
+ self->image_area.y + 0.5,
+ self->image_area.width,
+ self->image_area.height);
+ cairo_fill (cr);
+ break;
+
+ default:
+ break;
+ }
+ }
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]