summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <sandmann@redhat.com>2009-04-01 00:17:36 -0400
committerSøren Sandmann Pedersen <sandmann@redhat.com>2009-04-01 00:18:06 -0400
commitb6ef11a420da53e40bc38e81dbea0c1df6d653ac (patch)
tree4c6eb97cb8f3919cd1fbc26791510619471367b0
parent822d90915d3e202df620fc573bf51ffea091caa1 (diff)
Make the region smallerlinear
-rw-r--r--region_to_path.c40
1 files changed, 26 insertions, 14 deletions
diff --git a/region_to_path.c b/region_to_path.c
index bf1f2dd..84e4ede 100644
--- a/region_to_path.c
+++ b/region_to_path.c
@@ -3,16 +3,16 @@
#include <cairo.h>
static const cairo_rectangle_int_t rects[] = {
- { 0, 100, 400, 200 },
- { 500, 00, 400, 200 },
- { 1000, 00, 100, 700 },
- { 800, 200, 100, 200 },
- { 200, 300, 100, 100 },
- { 100, 400, 300, 300 },
- { 00, 600, 100, 100 },
- { 400, 500, 200, 200 },
- { 500, 300, 200, 200 },
- { 700, 400, 200, 300 },
+ { 0, 50, 200, 100 },
+ { 250, 0, 200, 100 },
+ { 500, 0, 50, 350 },
+ { 400, 100, 50, 100 },
+ { 100, 150, 50, 50 },
+ { 50, 200, 150, 150 },
+ { 0, 300, 50, 50 },
+ { 200, 250, 100, 100 },
+ { 250, 150, 100, 100 },
+ { 350, 200, 100, 150 },
};
typedef struct hsegment_t hsegment_t;
@@ -222,12 +222,16 @@ on_expose (GtkWidget *widget, GdkEvent *event, gpointer data)
#if 0
cairo_region_get_extents (region, &rect);
- cairo_rectangle (cr, rect.x, rect.y, rect.width + 100, rect.height + 100);
- cairo_set_source_rgba (cr, 0, 0, 1, 1);
- cairo_fill (cr);
#endif
- cairo_region_translate (region, 50, 50);
+#if 0
+ rect.x = 100;
+ rect.y = 250;
+ rect.width = 50;
+ rect.height = 50;
+
+ cairo_region_subtract_rectangle (region, &rect);
+#endif
region_to_path (cr, region);
@@ -239,6 +243,14 @@ on_expose (GtkWidget *widget, GdkEvent *event, gpointer data)
cairo_stroke (cr);
+#if 0
+ cairo_new_path (cr);
+
+ cairo_rectangle (cr, rect.x, rect.y, rect.width, rect.height);
+ cairo_set_source_rgba (cr, 0, 0, 1, 1);
+ cairo_fill (cr);
+#endif
+
cairo_destroy (cr);
cairo_region_destroy (region);