|
|
@ -725,11 +725,6 @@ NAN_METHOD(Context2d::DrawImage) { |
|
|
|
// Start draw
|
|
|
|
cairo_save(ctx); |
|
|
|
|
|
|
|
context->savePath(); |
|
|
|
cairo_rectangle(ctx, dx, dy, dw, dh); |
|
|
|
cairo_clip(ctx); |
|
|
|
context->restorePath(); |
|
|
|
|
|
|
|
// Scale src
|
|
|
|
if (dw != sw || dh != sh) { |
|
|
|
float fx = (float) dw / sw; |
|
|
@ -739,6 +734,18 @@ NAN_METHOD(Context2d::DrawImage) { |
|
|
|
dy /= fy; |
|
|
|
} |
|
|
|
|
|
|
|
if (context->hasShadow()) { |
|
|
|
context->setSourceRGBA(context->state->shadow); |
|
|
|
cairo_mask_surface(ctx, surface, |
|
|
|
dx - sx + context->state->shadowOffsetX, |
|
|
|
dy - sy + context->state->shadowOffsetY); |
|
|
|
} |
|
|
|
|
|
|
|
context->savePath(); |
|
|
|
cairo_rectangle(ctx, dx, dy, dw, dh); |
|
|
|
cairo_clip(ctx); |
|
|
|
context->restorePath(); |
|
|
|
|
|
|
|
// Paint
|
|
|
|
cairo_set_source_surface(ctx, surface, dx - sx, dy - sy); |
|
|
|
cairo_pattern_set_filter(cairo_get_source(ctx), context->state->patternQuality); |
|
|
|