Index: trunk/src/data.h =================================================================== --- trunk/src/data.h (revision 678) +++ trunk/src/data.h (revision 679) @@ -31,6 +31,7 @@ #include "camv_typedefs.h" #include #include +#include #include #include "rtree.h" @@ -51,9 +52,14 @@ char *name, *short_name; camv_design_t *parent; + unsigned sub:1; /* if 1, layer is a sub-layer in compositing; a main layer is the first of a series of composite layers; sub layers are not visible in the layer sel */ unsigned vis:1; /* for main layers: UI visibility */ unsigned clearing:1; /* if 1, the layer is negative, clearing layer */ + + + /* cache */ + rnd_xform_mx_t mx; }; extern camv_design_t camv; Index: trunk/src/draw.c =================================================================== --- trunk/src/draw.c (revision 678) +++ trunk/src/draw.c (revision 679) @@ -31,10 +31,11 @@ { camv_rtree_it_t it; void *o; + rnd_xform_mx_t *mx = NULL; for(o = camv_rtree_first(&it, &ly->objs, (camv_rtree_box_t *)®ion->view); o != NULL; o = camv_rtree_next(&it)) { camv_any_obj_t *obj = o; - obj->proto.calls->draw(obj, gc); + obj->proto.calls->draw(obj, gc, mx); } } Index: trunk/src/obj_arc.c =================================================================== --- trunk/src/obj_arc.c (revision 678) +++ trunk/src/obj_arc.c (revision 679) @@ -38,7 +38,7 @@ /* no dynamic allocation */ } -static void camv_arc_draw(camv_any_obj_t *obj, rnd_hid_gc_t gc) +static void camv_arc_draw(camv_any_obj_t *obj, rnd_hid_gc_t gc, rnd_xform_mx_t *mx) { rnd_hid_set_line_cap(gc, rnd_cap_round); rnd_hid_set_line_width(gc, obj->arc.thick); Index: trunk/src/obj_common.h =================================================================== --- trunk/src/obj_common.h (revision 678) +++ trunk/src/obj_common.h (revision 679) @@ -31,7 +31,9 @@ #include "camv_typedefs.h" #include "rtree.h" #include +#include + typedef enum camv_objtype_e { CAMV_OBJ_invalid, CAMV_OBJ_ARC, @@ -45,7 +47,7 @@ typedef struct camv_objcalls_s { camv_any_obj_t *(*alloc)(void); void (*free_fields)(camv_any_obj_t *obj); - void (*draw)(camv_any_obj_t *obj, rnd_hid_gc_t gc); + void (*draw)(camv_any_obj_t *obj, rnd_hid_gc_t gc, rnd_xform_mx_t *mx); void (*bbox)(camv_any_obj_t *obj); void (*copy)(camv_any_obj_t *dst, const camv_any_obj_t *src); void (*move)(camv_any_obj_t *o, rnd_coord_t dx, rnd_coord_t dy); /* does not do any rtree administration, but bbox is updated if it was originally valid */ Index: trunk/src/obj_grp.c =================================================================== --- trunk/src/obj_grp.c (revision 678) +++ trunk/src/obj_grp.c (revision 679) @@ -40,12 +40,12 @@ obj->grp.len = 0; } -static void camv_grp_draw(camv_any_obj_t *obj, rnd_hid_gc_t gc) +static void camv_grp_draw(camv_any_obj_t *obj, rnd_hid_gc_t gc, rnd_xform_mx_t *mx) { rnd_cardinal_t n; camv_any_obj_t *gobj; for(n = 0, gobj = obj->grp.objs; n < obj->grp.len; n++,gobj++) - gobj->proto.calls->draw(gobj, gc); + gobj->proto.calls->draw(gobj, gc, mx); } static void camv_grp_bbox(camv_any_obj_t *obj) Index: trunk/src/obj_line.c =================================================================== --- trunk/src/obj_line.c (revision 678) +++ trunk/src/obj_line.c (revision 679) @@ -38,7 +38,7 @@ /* no dynamic allocation */ } -static void camv_line_draw(camv_any_obj_t *obj, rnd_hid_gc_t gc) +static void camv_line_draw(camv_any_obj_t *obj, rnd_hid_gc_t gc, rnd_xform_mx_t *mx) { rnd_hid_set_line_cap(gc, rnd_cap_round); rnd_hid_set_line_width(gc, obj->line.thick); Index: trunk/src/obj_poly.c =================================================================== --- trunk/src/obj_poly.c (revision 678) +++ trunk/src/obj_poly.c (revision 679) @@ -39,7 +39,7 @@ obj->poly.len = 0; } -static void camv_poly_draw(camv_any_obj_t *obj, rnd_hid_gc_t gc) +static void camv_poly_draw(camv_any_obj_t *obj, rnd_hid_gc_t gc, rnd_xform_mx_t *mx) { rnd_render->fill_polygon(gc, obj->poly.len, obj->poly.x, obj->poly.y); } Index: trunk/src/obj_text.c =================================================================== --- trunk/src/obj_text.c (revision 678) +++ trunk/src/obj_text.c (revision 679) @@ -54,7 +54,7 @@ obj->text.s = NULL; } -static void camv_text_draw(camv_any_obj_t *obj, rnd_hid_gc_t gc) +static void camv_text_draw(camv_any_obj_t *obj, rnd_hid_gc_t gc, rnd_xform_mx_t *mx) { if ((rnd_render->draw_pixmap != NULL) && (obj->text.pm != NULL)) rnd_render->draw_pixmap(rnd_render, obj->text.x, obj->text.y, obj->text.sx, obj->text.sy, obj->text.pm);