Browse Source

Merge pull request #381 from mojodna/add-operator

Distinguish between 'add' and 'lighter'
v1.x
Nathan Rajlich 11 years ago
parent
commit
154d586d17
  1. 6
      src/CanvasRenderingContext2d.cc

6
src/CanvasRenderingContext2d.cc

@ -740,7 +740,6 @@ NAN_GETTER(Context2d::GetGlobalCompositeOperation) {
case CAIRO_OPERATOR_DEST_IN: op = "destination-in"; break;
case CAIRO_OPERATOR_DEST_OUT: op = "destination-out"; break;
case CAIRO_OPERATOR_DEST_OVER: op = "destination-over"; break;
case CAIRO_OPERATOR_ADD: op = "lighter"; break;
case CAIRO_OPERATOR_CLEAR: op = "clear"; break;
case CAIRO_OPERATOR_SOURCE: op = "source"; break;
case CAIRO_OPERATOR_DEST: op = "dest"; break;
@ -749,6 +748,7 @@ NAN_GETTER(Context2d::GetGlobalCompositeOperation) {
// Non-standard
// supported by resent versions of cairo
#if CAIRO_VERSION_MINOR >= 10
case CAIRO_OPERATOR_ADD: op = "add"; break;
case CAIRO_OPERATOR_LIGHTEN: op = "lighter"; break;
case CAIRO_OPERATOR_DARKEN: op = "darker"; break;
case CAIRO_OPERATOR_MULTIPLY: op = "multiply"; break;
@ -764,6 +764,8 @@ NAN_GETTER(Context2d::GetGlobalCompositeOperation) {
case CAIRO_OPERATOR_COLOR_BURN: op = "color-burn"; break;
case CAIRO_OPERATOR_DIFFERENCE: op = "difference"; break;
case CAIRO_OPERATOR_EXCLUSION: op = "exclusion"; break;
#else
case CAIRO_OPERATOR_ADD: op = "lighter"; break;
#endif
}
@ -845,6 +847,8 @@ NAN_SETTER(Context2d::SetGlobalCompositeOperation) {
// Non-standard
// supported by resent versions of cairo
#if CAIRO_VERSION_MINOR >= 10
} else if (0 == strcmp("add", *type)) {
cairo_set_operator(ctx, CAIRO_OPERATOR_ADD);
} else if (0 == strcmp("lighter", *type)) {
cairo_set_operator(ctx, CAIRO_OPERATOR_LIGHTEN);
} else if (0 == strcmp("darker", *type)) {

Loading…
Cancel
Save