diff options
| author | Bryce Harrington <b.harrington@samsung.com> | 2014-05-05 18:25:26 -0700 |
|---|---|---|
| committer | Bryce Harrington <b.harrington@samsung.com> | 2014-05-05 18:25:26 -0700 |
| commit | 4d07d2c6fe9e77f5fecbe19528cb54cc06f0e8bd (patch) | |
| tree | b8fad0a12c1ea7bfa419942f81c6813da13ac115 /src/cairo-tests | |
| parent | 398770f6d07eb5916e12545b8d223b34fa69fd6e (diff) | |
Rename centre to center
Diffstat (limited to 'src/cairo-tests')
| -rw-r--r-- | src/cairo-tests/clip.cpp | 4 | ||||
| -rw-r--r-- | src/cairo-tests/fill.cpp | 46 | ||||
| -rw-r--r-- | src/cairo-tests/stroke.cpp | 10 |
3 files changed, 30 insertions, 30 deletions
diff --git a/src/cairo-tests/clip.cpp b/src/cairo-tests/clip.cpp index 194c326..0a0fee6 100644 --- a/src/cairo-tests/clip.cpp +++ b/src/cairo-tests/clip.cpp @@ -53,8 +53,8 @@ void drawShape(caskbench_context_t *ctx,double x,double y,double clipr=0,bool is shape = ((4.0 * rand())/RAND_MAX) +1; else shape = ctx->shape_args.shape_id ; - ctx->shape_args.centre_x = x; - ctx->shape_args.centre_y = y; + ctx->shape_args.center_x = x; + ctx->shape_args.center_y = y; ctx->shape_args.radius = isClip?clipr:r; ctx->shape_args.width = (ctx->shape_args.width)?ctx->shape_args.width:2*(isClip?clipr:r); ctx->shape_args.height = (ctx->shape_args.height)?ctx->shape_args.height:2*(isClip?clipr:r); 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; } diff --git a/src/cairo-tests/stroke.cpp b/src/cairo-tests/stroke.cpp index 2b2f218..3f0e144 100644 --- a/src/cairo-tests/stroke.cpp +++ b/src/cairo-tests/stroke.cpp @@ -61,16 +61,16 @@ static void drawShape(caskbench_context_t *ctx,double x,double y) switch (shape) { case 1: // Circle - ctx->shape_args.centre_x = x+r; - ctx->shape_args.centre_y = y+r; + ctx->shape_args.center_x = x+r; + ctx->shape_args.center_y = y+r; ctx->shape_args.radius = r; cairoShapes[Circle](ctx,&ctx->shape_args); break; case 2: // Rectangle - ctx->shape_args.centre_x = x; - ctx->shape_args.centre_y = y; + ctx->shape_args.center_x = x; + ctx->shape_args.center_y = 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; cairoShapes[Rectangle](ctx,&ctx->shape_args); @@ -159,7 +159,7 @@ ca_test_stroke(caskbench_context_t *ctx) } else //drawStroke(ctx,NULL); - ctx->shape_args.multi_shapes?drawStroke(ctx,NULL):drawShape(ctx,ctx->shape_args.centre_x?ctx->shape_args.centre_x:100.0,ctx->shape_args.centre_y?ctx->shape_args.centre_y:100.0); + ctx->shape_args.multi_shapes?drawStroke(ctx,NULL):drawShape(ctx,ctx->shape_args.center_x?ctx->shape_args.center_x:100.0,ctx->shape_args.center_y?ctx->shape_args.center_y:100.0); return 1; } |