diff options
Diffstat (limited to 'src/cairo-tests/fill.cpp')
| -rw-r--r-- | src/cairo-tests/fill.cpp | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/src/cairo-tests/fill.cpp b/src/cairo-tests/fill.cpp index 4d2138d..fdc40f0 100644 --- a/src/cairo-tests/fill.cpp +++ b/src/cairo-tests/fill.cpp @@ -51,10 +51,10 @@ void drawshapes(caskbench_context_t *ctx,kinetics_t *particles) if(shape) { - if(!(ctx->shape_args.centre_x && ctx->shape_args.centre_y)) + if(!(ctx->shape_args.center_x && ctx->shape_args.center_y)) { - ctx->shape_args.centre_x = x = ctx->canvas_width/2; - ctx->shape_args.centre_y = y = ctx->canvas_height/2; + ctx->shape_args.center_x = x = ctx->canvas_width/2; + ctx->shape_args.center_y = y = ctx->canvas_height/2; } if(!ctx->shape_args.multi_shapes) if(!(ctx->shape_args.width && ctx->shape_args.height)) @@ -72,8 +72,8 @@ void drawshapes(caskbench_context_t *ctx,kinetics_t *particles) num_y_elements = 1; r = 40; - old_x = ctx->shape_args.centre_x; - old_y = ctx->shape_args.centre_y; + old_x = ctx->shape_args.center_x; + old_y = ctx->shape_args.center_y; old_width = ctx->shape_args.width; old_height = ctx->shape_args.height; } @@ -127,16 +127,16 @@ void drawshapes(caskbench_context_t *ctx,kinetics_t *particles) switch (shape) { case 1: // Circle - ctx->shape_args.centre_x = (ctx->shape_args.multi_shapes || ctx->shape_args.animation)?x+r:ctx->shape_args.centre_x; - ctx->shape_args.centre_y = (ctx->shape_args.multi_shapes || ctx->shape_args.animation)?y+r:ctx->shape_args.centre_y; + ctx->shape_args.center_x = (ctx->shape_args.multi_shapes || ctx->shape_args.animation)?x+r:ctx->shape_args.center_x; + ctx->shape_args.center_y = (ctx->shape_args.multi_shapes || ctx->shape_args.animation)?y+r:ctx->shape_args.center_y; ctx->shape_args.radius = r; if(ctx->shape_args.fill_type != NULL) { if((strcmp(ctx->shape_args.fill_type,"radial-gradient")) == 0) - pattern = cairo_pattern_create_radial (ctx->shape_args.centre_x, ctx->shape_args.centre_y ,r,ctx->shape_args.centre_x, ctx->shape_args.centre_y,0 ); + pattern = cairo_pattern_create_radial (ctx->shape_args.center_x, ctx->shape_args.center_y ,r,ctx->shape_args.center_x, ctx->shape_args.center_y,0 ); else if((strcmp(ctx->shape_args.fill_type,"linear-gradient")) == 0) - pattern = cairo_pattern_create_linear (0, ctx->shape_args.centre_y-r ,0, ctx->shape_args.centre_y+r ); + pattern = cairo_pattern_create_linear (0, ctx->shape_args.center_y-r ,0, ctx->shape_args.center_y+r ); if((strcmp(ctx->shape_args.fill_type,"linear-gradient")) == 0) cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT); @@ -153,22 +153,22 @@ void drawshapes(caskbench_context_t *ctx,kinetics_t *particles) case 2: // Rectangle - ctx->shape_args.centre_x = (ctx->shape_args.multi_shapes || ctx->shape_args.animation)?x:ctx->shape_args.centre_x; - ctx->shape_args.centre_y = (ctx->shape_args.multi_shapes|| ctx->shape_args.animation)?y:ctx->shape_args.centre_y; + ctx->shape_args.center_x = (ctx->shape_args.multi_shapes || ctx->shape_args.animation)?x:ctx->shape_args.center_x; + ctx->shape_args.center_y = (ctx->shape_args.multi_shapes|| ctx->shape_args.animation)?y:ctx->shape_args.center_y; ctx->shape_args.width = (ctx->shape_args.width)?ctx->shape_args.width:2*r; ctx->shape_args.height = (ctx->shape_args.height)?ctx->shape_args.height:2*r; if(ctx->shape_args.fill_type != NULL) { if((strcmp(ctx->shape_args.fill_type,"radial-gradient")) == 0) - pattern = cairo_pattern_create_radial (ctx->shape_args.centre_x+(ctx->shape_args.width/2), - ctx->shape_args.centre_y+(ctx->shape_args.height/2), - ctx->shape_args.height/2, ctx->shape_args.centre_x+(ctx->shape_args.width/2), - ctx->shape_args.centre_y+(ctx->shape_args.height/2), + pattern = cairo_pattern_create_radial (ctx->shape_args.center_x+(ctx->shape_args.width/2), + ctx->shape_args.center_y+(ctx->shape_args.height/2), + ctx->shape_args.height/2, ctx->shape_args.center_x+(ctx->shape_args.width/2), + ctx->shape_args.center_y+(ctx->shape_args.height/2), 0/*ctx->shape_args.height/2 */); else if((strcmp(ctx->shape_args.fill_type,"linear-gradient")) == 0) - pattern = cairo_pattern_create_linear (0, ctx->shape_args.centre_y, 0, - ctx->shape_args.centre_y+ctx->shape_args.height ); + pattern = cairo_pattern_create_linear (0, ctx->shape_args.center_y, 0, + ctx->shape_args.center_y+ctx->shape_args.height ); if((strcmp(ctx->shape_args.fill_type,"linear-gradient")) == 0) cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT); @@ -189,8 +189,8 @@ void drawshapes(caskbench_context_t *ctx,kinetics_t *particles) ctx->shape_args.numpoints = 3; if( (!ctx->shape_args.multi_shapes && !ctx->shape_args.animation)) { - x = ctx->shape_args.centre_x; - y = ctx->shape_args.centre_y; + x = ctx->shape_args.center_x; + y = ctx->shape_args.center_y; } ctx->shape_args.points = (double (*)[2]) malloc(ctx->shape_args.numpoints*2*(sizeof(double))); ctx->shape_args.points[0][0] = x; @@ -227,8 +227,8 @@ void drawshapes(caskbench_context_t *ctx,kinetics_t *particles) // Star if ((!ctx->shape_args.multi_shapes && !ctx->shape_args.animation)) { - x = ctx->shape_args.centre_x; - y = ctx->shape_args.centre_y; + x = ctx->shape_args.center_x; + y = ctx->shape_args.center_y; } ctx->shape_args.numpoints = 10; ctx->shape_args.points = (double (*)[2]) malloc(ctx->shape_args.numpoints*2*(sizeof(double))); @@ -303,8 +303,8 @@ void drawshapes(caskbench_context_t *ctx,kinetics_t *particles) if (!ctx->shape_args.animation && !ctx->shape_args.multi_shapes) { - ctx->shape_args.centre_x = old_x; - ctx->shape_args.centre_y = old_y; + ctx->shape_args.center_x = old_x; + ctx->shape_args.center_y = old_y; ctx->shape_args.width = old_width; ctx->shape_args.height = old_height; } |