comparison src/shape_path.c @ 26:d50f33040de6

Set line width for path. - consider width of line when compute bounding box area.
author Thinker K.F. Li <thinker@branda.to>
date Sun, 03 Aug 2008 13:04:55 +0800
parents 8fcf2d878ecd
children e06a4a667ce2
comparison
equal deleted inserted replaced
25:29937c26bb01 26:d50f33040de6
392 */ 392 */
393 void sh_path_transform(shape_t *shape) { 393 void sh_path_transform(shape_t *shape) {
394 sh_path_t *path; 394 sh_path_t *path;
395 co_aix *user_args, *dev_args; 395 co_aix *user_args, *dev_args;
396 co_aix (*poses)[2]; 396 co_aix (*poses)[2];
397 area_t *area;
397 int arg_len; 398 int arg_len;
398 int i; 399 int i;
399 400
400 ASSERT(shape->type == SHT_PATH); 401 ASSERT(shape->type == SHT_PATH);
401 ASSERT((shape->arg_len & 0x1) == 0); 402 ASSERT((shape->arg_len & 0x1) == 0);
412 } 413 }
413 414
414 if(path->shape.geo) { 415 if(path->shape.geo) {
415 poses = (co_aix (*)[2])(path->dev_data + path->cmd_len); 416 poses = (co_aix (*)[2])(path->dev_data + path->cmd_len);
416 geo_from_positions(path->shape.geo, arg_len / 2, poses); 417 geo_from_positions(path->shape.geo, arg_len / 2, poses);
418 area = shape->geo->cur_area;
419 area->x -= shape->stroke_width/2 + 1;
420 area->y -= shape->stroke_width/2 + 1;
421 area->w += shape->stroke_width + 2;
422 area->h += shape->stroke_width + 2;
417 } 423 }
418 } 424 }
419 425
420 static void sh_path_path(shape_t *shape, cairo_t *cr) { 426 static void sh_path_path(shape_t *shape, cairo_t *cr) {
421 sh_path_t *path; 427 sh_path_t *path;