Skip to content

Commit

Permalink
adds setTransform to the canvas context
Browse files Browse the repository at this point in the history
  • Loading branch information
fairfieldt committed Jun 16, 2014
1 parent f17d920 commit 6356972
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tealeaf_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -907,3 +907,15 @@ void context_2d_drawImage(context_2d *ctx, int srcTex, const char *url, const re
draw_textures_item(ctx, GET_MODEL_VIEW_MATRIX(ctx), tex->name, tex->width, tex->height, tex->originalWidth, tex->originalHeight, *srcRect, *destRect, * GET_CLIPPING_BOUNDS(ctx), ctx->globalAlpha[ctx->mvp], ctx->globalCompositeOperation[ctx->mvp], &ctx->filter_color, ctx->filter_type);
}
}

void context_2d_setTransform(context_2d *ctx, double m11, double m12, double m21, double m22, double dx, double dy) {
context_2d_bind(ctx);
matrix_3x3 *m = GET_MODEL_VIEW_MATRIX(ctx);
m->m00 = m11;
m->m01 = m21;
m->m10 = m12;
m->m11 = m22;
m->m02 = dx;
m->m12 = dy;

}
1 change: 1 addition & 0 deletions tealeaf_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ void context_2d_set_filter_type(context_2d *ctx, int filter_type);
void disable_scissor(context_2d *ctx);
void enable_scissor(context_2d *ctx);

void context_2d_setTransform(context_2d *ctx, double m11, double m12, double m21, double m22, double dx, double dy);
#ifdef __cplusplus
}
#endif
Expand Down

0 comments on commit 6356972

Please sign in to comment.