diff options
Diffstat (limited to 'chisel/box.cpp')
| -rw-r--r-- | chisel/box.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/chisel/box.cpp b/chisel/box.cpp index e8e3207..b0d11c5 100644 --- a/chisel/box.cpp +++ b/chisel/box.cpp @@ -23,10 +23,16 @@ namespace chisel { } void Box::draw() { - fill_rect(0, 0, width, height, width % 256, height % 256, (width + height) % 256); + Color color = { + width % 256, + height % 256, + (width + height) % 256 + }; + + fill_rect(0, 0, width, height, color); } - void Box::fill_rect(int x0, int y0, int w, int h, int r, int g, int b) { + void Box::fill_rect(int x0, int y0, int w, int h, Color color) { if (!parent) return; @@ -39,7 +45,7 @@ namespace chisel { if (y0 + h >= height) h = height - x0; - parent->fill_rect(x + x0, y + y0, w, h, r, g, b); + parent->fill_rect(x + x0, y + y0, w, h, color); } void Box::add_child(Box *child) { |
