view doodle/cairo/routines.d @ 38:452915ecd1f4

Basic logging functionality
author David Bryant <bagnose@gmail.com>
date Sun, 27 Sep 2009 22:51:03 +0930
parents 3f6bb0bb22dc
children 1f97022e5c6d
line wrap: on
line source

module doodle.cairo.routines;

public {
    import doodle.tk.geometry;
    import cairo.Context;
}

void rectangle(scope Context cr, in Rectangle rectangle) {
    cr.rectangle(rectangle.position.x, rectangle.position.y,
                 rectangle.size.x, rectangle.size.y);
}

void line(scope Context cr, in double x0, in double y0, in double x1, in double y1) {
    cr.moveTo(x0, y0);
    cr.lineTo(x1, y1);
}

// Horizontal line
void hline(scope Context cr, in double y, double x0, double x1) {
    cr.moveTo(x0, y);
    cr.lineTo(x1, y);
}

// Vertical line
void vline(scope Context cr, in double x, double y0, double y1) {
    cr.moveTo(x, y0);
    cr.lineTo(x, y1);
}