Mercurial > MadButterfly
comparison src/shape_path.c @ 22:8fcf2d878ecd
shapes with stroke
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Sat, 02 Aug 2008 16:20:15 +0800 |
parents | 74d3d5dc9aaa |
children | d50f33040de6 |
comparison
equal
deleted
inserted
replaced
21:83d24300a992 | 22:8fcf2d878ecd |
---|---|
415 poses = (co_aix (*)[2])(path->dev_data + path->cmd_len); | 415 poses = (co_aix (*)[2])(path->dev_data + path->cmd_len); |
416 geo_from_positions(path->shape.geo, arg_len / 2, poses); | 416 geo_from_positions(path->shape.geo, arg_len / 2, poses); |
417 } | 417 } |
418 } | 418 } |
419 | 419 |
420 void sh_path_fill(shape_t *shape, cairo_t *cr) { | 420 static void sh_path_path(shape_t *shape, cairo_t *cr) { |
421 sh_path_t *path; | 421 sh_path_t *path; |
422 int cmd_len; | 422 int cmd_len; |
423 char *cmds, cmd; | 423 char *cmds, cmd; |
424 co_aix *args; | 424 co_aix *args; |
425 co_aix x, y, x1, y1, x2, y2; | 425 co_aix x, y, x1, y1, x2, y2; |
534 case '\x0': | 534 case '\x0': |
535 i = cmd_len; /* padding! Skip remain ones. */ | 535 i = cmd_len; /* padding! Skip remain ones. */ |
536 break; | 536 break; |
537 } | 537 } |
538 } | 538 } |
539 | 539 } |
540 | |
541 void sh_path_fill(shape_t *shape, cairo_t *cr) { | |
542 sh_path_path(shape, cr); | |
540 cairo_fill(cr); | 543 cairo_fill(cr); |
544 } | |
545 | |
546 void sh_path_stroke(shape_t *shape, cairo_t *cr) { | |
547 sh_path_path(shape, cr); | |
548 cairo_stroke(cr); | |
541 } | 549 } |
542 | 550 |
543 #ifdef UNITTEST | 551 #ifdef UNITTEST |
544 | 552 |
545 #include <CUnit/Basic.h> | 553 #include <CUnit/Basic.h> |