|
@ -1640,9 +1640,10 @@ Context2d::FillRect(const Arguments &args) { |
|
|
if (0 == width || 0 == height) return Undefined(); |
|
|
if (0 == width || 0 == height) return Undefined(); |
|
|
Context2d *context = ObjectWrap::Unwrap<Context2d>(args.This()); |
|
|
Context2d *context = ObjectWrap::Unwrap<Context2d>(args.This()); |
|
|
cairo_t *ctx = context->context(); |
|
|
cairo_t *ctx = context->context(); |
|
|
cairo_new_path(ctx); |
|
|
context->savePath(); |
|
|
cairo_rectangle(ctx, x, y, width, height); |
|
|
cairo_rectangle(ctx, x, y, width, height); |
|
|
context->fill(); |
|
|
context->fill(); |
|
|
|
|
|
context->restorePath(); |
|
|
return Undefined(); |
|
|
return Undefined(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -1657,9 +1658,10 @@ Context2d::StrokeRect(const Arguments &args) { |
|
|
if (0 == width && 0 == height) return Undefined(); |
|
|
if (0 == width && 0 == height) return Undefined(); |
|
|
Context2d *context = ObjectWrap::Unwrap<Context2d>(args.This()); |
|
|
Context2d *context = ObjectWrap::Unwrap<Context2d>(args.This()); |
|
|
cairo_t *ctx = context->context(); |
|
|
cairo_t *ctx = context->context(); |
|
|
cairo_new_path(ctx); |
|
|
context->savePath(); |
|
|
cairo_rectangle(ctx, x, y, width, height); |
|
|
cairo_rectangle(ctx, x, y, width, height); |
|
|
context->stroke(); |
|
|
context->stroke(); |
|
|
|
|
|
context->restorePath(); |
|
|
return Undefined(); |
|
|
return Undefined(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|