Right now, shoes differs from other rendering APIs by painting fills
over top of strokes rather than strokes over fills.  I think the
following patch, which reverses this, makes Shoes nicer to work with.

(it also updates clock.rb to keep the same appearance after the change)

-mental

diff --git a/shoes/ruby.c b/shoes/ruby.c
index 01114aa..5e3a4cc 100644
--- a/shoes/ruby.c
+++ b/shoes/ruby.c
@@ -663,8 +663,8 @@ shoes_shape_draw(VALUE self, VALUE c, VALUE actual)
     cairo_new_path(canvas->cr);
     cairo_append_path(canvas->cr, self_t->line);
 
-    PATH_OUT(fg, cairo_stroke_preserve);
-    PATH_OUT(bg, cairo_fill);
+    PATH_OUT(bg, cairo_fill_preserve);
+    PATH_OUT(fg, cairo_stroke);
 
     cairo_restore(canvas->cr);
   }
diff --git a/samples/clock.rb b/samples/clock.rb
index 5f2f715..2b05e2e 100644
--- a/samples/clock.rb
+++ b/samples/clock.rb
@@ -26,7 +26,9 @@ Shoes.app :height => 260, :width => 250 do
     background rgb(230, 240, 200)
 
     fill white
-    oval @centerx - 100, @centery - 100, 200, 200
+    stroke black
+    strokewidth 4
+    oval @centerx - 102, @centery - 102, 204, 204
 
     fill black
     nostroke


Reply via email to