Skip to content

Commit

Permalink
add Draw#clear
Browse files Browse the repository at this point in the history
  • Loading branch information
Watson1978 committed Mar 2, 2016
1 parent 972fd11 commit 98cc463
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,17 @@ draw_alloc(VALUE rcv, SEL sel)

/// @group Draw Operations

/// @method #clear
/// Clears drew shapes.
/// @return [Draw] the receiver.

static VALUE
draw_clear(VALUE rcv, SEL sel)
{
DRAW(rcv)->clear();
return rcv;
}

/// @method #dot(pos, radius, color)
/// Draws a filled circle at the given position with the given radius and color.
/// @param pos [Point] the position where to draw.
Expand Down Expand Up @@ -455,6 +466,7 @@ Init_Node(void)
rb_cDrawNode = rb_define_class_under(rb_mMC, "Draw", rb_cNode);

rb_define_singleton_method(rb_cDrawNode, "alloc", draw_alloc, 0);
rb_define_method(rb_cDrawNode, "clear", draw_clear, 0);
rb_define_method(rb_cDrawNode, "dot", draw_dot, 3);
rb_define_method(rb_cDrawNode, "rect", draw_rect, -1);
rb_define_method(rb_cDrawNode, "line", draw_line, -1);
Expand Down

0 comments on commit 98cc463

Please sign in to comment.