Browse Source

globalAlpha ignored when < 0 or > 1

v1.x
Tj Holowaychuk 14 years ago
parent
commit
3afc9851ce
  1. 11
      src/context2d.cc

11
src/context2d.cc

@ -24,6 +24,10 @@ using namespace node;
_.b = B / 255 * 1; \
_.a = A; \
/*
* Set source.
*/
#define SET_SOURCE(C) \
if (C##Pattern) \
cairo_set_source(ctx, C##Pattern); \
@ -151,8 +155,11 @@ Context2d::GetGlobalAlpha(Local<String> prop, const AccessorInfo &info) {
void
Context2d::SetGlobalAlpha(Local<String> prop, Local<Value> val, const AccessorInfo &info) {
Context2d *context = ObjectWrap::Unwrap<Context2d>(info.This());
context->globalAlpha = val->NumberValue();
double n = val->NumberValue();
if (n >= 0 && n <= 1) {
Context2d *context = ObjectWrap::Unwrap<Context2d>(info.This());
context->globalAlpha = n;
}
}
/*

Loading…
Cancel
Save