]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/mag-gfx/lib/canvas.cc
update
[l4.git] / l4 / pkg / mag-gfx / lib / canvas.cc
1 /*
2  * (c) 2009 Alexander Warg <warg@os.inf.tu-dresden.de>
3  *     economic rights: Technische Universität Dresden (Germany)
4  *
5  * This file is part of TUD:OS and distributed under the terms of the
6  * GNU General Public License 2.
7  * Please see the COPYING-GPL-2 file for details.
8  */
9 #include <l4/mag-gfx/canvas>
10
11 namespace Mag_gfx {
12
13 void
14 Canvas::draw_rect(Rect const &r, Rgba32::Color color, int width)
15 {
16   Rect_tuple t;
17   if (width > 0)
18     t = r - r.offset(width, width, -width, -width);
19   else
20     t = r.offset(width, width, -width, -width) - r;
21
22   draw_box(t[0], color);
23   draw_box(t[1], color);
24   draw_box(t[2], color);
25   draw_box(t[3], color);
26 }
27
28 }