Browse Source

new path on {stroke,fill}Rect()

v1.x
Tj Holowaychuk 15 years ago
parent
commit
b51b617e4d
  1. 2
      src/CanvasRenderingContext2d.cc
  2. 2
      test/canvas.test.js

2
src/CanvasRenderingContext2d.cc

@ -801,6 +801,7 @@ Context2d::FillRect(const Arguments &args) {
if (0 == width || 0 == height) return Undefined();
Context2d *context = ObjectWrap::Unwrap<Context2d>(args.This());
cairo_t *ctx = context->getContext();
cairo_new_path(ctx);
cairo_rectangle(ctx, x, y, width, height);
SET_SOURCE(context->state->fill);
cairo_fill(ctx);
@ -818,6 +819,7 @@ Context2d::StrokeRect(const Arguments &args) {
if (0 == width && 0 == height) return Undefined();
Context2d *context = ObjectWrap::Unwrap<Context2d>(args.This());
cairo_t *ctx = context->getContext();
cairo_new_path(ctx);
cairo_rectangle(ctx, x, y, width, height);
SET_SOURCE(context->state->stroke);
cairo_stroke(ctx);

2
test/canvas.test.js

@ -412,7 +412,7 @@ module.exports = {
assertChecksum(
canvas
, path
, 'fc8bbf2cf6ae2d85fcf526103200e844'
, '65a027e653ea817747ba73053d48272a'
, 'Context2d#save() / restore() failed');
},

Loading…
Cancel
Save