Skip to content

Commit

Permalink
... and clearRect()
Browse files Browse the repository at this point in the history
Signed-off-by: Tj Holowaychuk <tj@vision-media.ca>
  • Loading branch information
atomizer authored and tj committed Apr 20, 2011
1 parent 5ae1c46 commit c8b82ae
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/CanvasRenderingContext2d.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1677,9 +1677,11 @@ Context2d::ClearRect(const Arguments &args) {
Context2d *context = ObjectWrap::Unwrap<Context2d>(args.This());
cairo_t *ctx = context->context();
cairo_save(ctx);
context->savePath();
cairo_rectangle(ctx, x, y, width, height);
cairo_set_operator(ctx, CAIRO_OPERATOR_CLEAR);
cairo_fill(ctx);
context->restorePath();
cairo_restore(ctx);
return Undefined();
}
Expand Down

0 comments on commit c8b82ae

Please sign in to comment.