summaryrefslogtreecommitdiffstatsci
path: root/src/cairo-tests/fill.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/cairo-tests/fill.cpp')
-rw-r--r--src/cairo-tests/fill.cpp23
1 files changed, 9 insertions, 14 deletions
diff --git a/src/cairo-tests/fill.cpp b/src/cairo-tests/fill.cpp
index af57da7..516b064 100644
--- a/src/cairo-tests/fill.cpp
+++ b/src/cairo-tests/fill.cpp
@@ -117,11 +117,16 @@ void drawshapes(caskbench_context_t *ctx,kinetics_t *particles)
}
+ if (!ctx->shape_args.multi_shapes && !ctx->shape_args.animation) {
+ x = ctx->shape_args.center_x;
+ y = ctx->shape_args.center_y;
+ }
+
switch (shape) {
case 1:
// Circle
- 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.center_x = x;
+ ctx->shape_args.center_y = y;
ctx->shape_args.radius = r;
if(ctx->shape_args.fill_type != NULL)
@@ -146,8 +151,8 @@ void drawshapes(caskbench_context_t *ctx,kinetics_t *particles)
case 2:
// Rectangle
- 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.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;
@@ -180,11 +185,6 @@ void drawshapes(caskbench_context_t *ctx,kinetics_t *particles)
case 3:
// Triangle
ctx->shape_args.numpoints = 3;
- if( (!ctx->shape_args.multi_shapes && !ctx->shape_args.animation))
- {
- 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;
ctx->shape_args.points[0][1] = y+2*r;
@@ -218,11 +218,6 @@ void drawshapes(caskbench_context_t *ctx,kinetics_t *particles)
case 4:
// Star
- if ((!ctx->shape_args.multi_shapes && !ctx->shape_args.animation))
- {
- 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)));