Browse Source

ClearRect() using save/restore instead of explicit set_operator call

v1.x
Tj Holowaychuk 14 years ago
parent
commit
7e27a59fe6
  1. 5
      src/CanvasRenderingContext2d.cc

5
src/CanvasRenderingContext2d.cc

@ -801,10 +801,11 @@ Context2d::ClearRect(const Arguments &args) {
if (0 == width || 0 == height) return Undefined();
Context2d *context = ObjectWrap::Unwrap<Context2d>(args.This());
cairo_t *ctx = context->getContext();
cairo_set_operator(ctx, CAIRO_OPERATOR_CLEAR);
cairo_save(ctx);
cairo_rectangle(ctx, x, y, width, height);
cairo_set_operator(ctx, CAIRO_OPERATOR_CLEAR);
cairo_fill(ctx);
cairo_set_operator(ctx, CAIRO_OPERATOR_OVER);
cairo_restore(ctx);
return Undefined();
}

Loading…
Cancel
Save