Revision 1184
Able to read and draw circles in the environment
gtk_environment_view.c | ||
---|---|---|
476 | 476 |
int i, j; |
477 | 477 |
GdkPoint* points; |
478 | 478 |
poly_t* p; |
479 |
circle_t* c; |
|
480 |
int x, y, r; |
|
479 | 481 |
|
480 | 482 |
if (!drawable || !gc || !world) |
481 | 483 |
return; |
... | ... | |
501 | 503 |
} |
502 | 504 |
free(points); |
503 | 505 |
break; |
506 |
case ID_CIRCLE: |
|
507 |
c = (circle_t*)o->props; |
|
508 |
to_window_scale(view, c->radius, &r); |
|
509 |
to_window_coordinates(view, c->center.x, c->center.y, &x, &y); |
|
510 |
gdk_draw_arc(drawable, gc, 1, |
|
511 |
(int)(x - (float)r / 2), |
|
512 |
(int)(y - (float)r / 2), |
|
513 |
r, r, 0, 360*64); |
|
514 |
break; |
|
504 | 515 |
// no object |
505 | 516 |
case ID_NULL: |
506 | 517 |
break; |
Also available in: Unified diff