Browse Source

Fixed globalAlpha. Closes #33

v1.x
Tj Holowaychuk 14 years ago
parent
commit
d5d79b7e62
  1. 6
      src/CanvasRenderingContext2d.cc

6
src/CanvasRenderingContext2d.cc

@ -43,9 +43,7 @@ using namespace node;
, _.r \ , _.r \
, _.g \ , _.g \
, _.b \ , _.b \
, context->state->globalAlpha == -1 \ , _.a * context->state->globalAlpha);
? _.a \
: context->state->globalAlpha);
/* /*
* Rectangle arg assertions. * Rectangle arg assertions.
@ -136,7 +134,7 @@ Context2d::Context2d(Canvas *canvas): ObjectWrap() {
cairo_set_line_width(_context, 1); cairo_set_line_width(_context, 1);
shadowBlur = shadowOffsetX = shadowOffsetY = 0; shadowBlur = shadowOffsetX = shadowOffsetY = 0;
state = states[stateno = 0] = (canvas_state_t *) malloc(sizeof(canvas_state_t)); state = states[stateno = 0] = (canvas_state_t *) malloc(sizeof(canvas_state_t));
state->globalAlpha = -1; state->globalAlpha = 1;
state->fillPattern = state->strokePattern = NULL; state->fillPattern = state->strokePattern = NULL;
RGBA(state->fill,0,0,0,1); RGBA(state->fill,0,0,0,1);
RGBA(state->stroke,0,0,0,1); RGBA(state->stroke,0,0,0,1);

Loading…
Cancel
Save