diff doodle/fig/diagram_elements.d @ 80:b759414d2b72

Switched from cairo to Drawable abstraction
author "David Bryant <bagnose@gmail.com>"
date Sun, 15 Aug 2010 23:43:04 +0930
parents 6f2525e170f2
children cdd4fc728d94
line wrap: on
line diff
--- a/doodle/fig/diagram_elements.d	Sun Aug 15 23:18:05 2010 +0930
+++ b/doodle/fig/diagram_elements.d	Sun Aug 15 23:43:04 2010 +0930
@@ -2,7 +2,7 @@
 
 private {
     import doodle.tk.geometry;
-    import doodle.tk.cairo;
+    import doodle.tk.drawable;
 }
 
 interface IDiagram {
@@ -12,7 +12,7 @@
 abstract class DiagramElement {
     Rectangle bounds() const;
 
-    void draw(in Rectangle damage, scope Context cr) const;
+    void draw(in Rectangle damage, scope Drawable cr) const;
 
     private {
         //GraphElement _container;                // FIXME use an interface to the container
@@ -64,8 +64,8 @@
  */
 
 final class RectanglePrimitive : GraphicPrimitive {
-    override void draw(in Rectangle damage, scope Context cr) const {
-        rectangle(cr, bounds);
+    override void draw(in Rectangle damage, scope Drawable drawable) const {
+        drawable.drawRectangle(bounds, false);
     }
 
     override Rectangle bounds() const { return _bounds; }