diff --git a/src/actions.c b/src/actions.c index 29b096e1..8f6eb49c 100644 --- a/src/actions.c +++ b/src/actions.c @@ -2067,6 +2067,20 @@ void change_layer() y2 = xctx->rect[c][n].y2; storeobject(-1, x1,y1,x2,y2,xRECT,xctx->rectcolor, 0, xctx->rect[c][n].prop_ptr); } + else if(type==xTEXT && xctx->text[n].sel==SELECTED) { + if(xctx->rectcolor != xctx->text[n].layer) { + char *p; + set_modify(1); + my_strdup(1386, &xctx->text[n].prop_ptr, + subst_token(xctx->text[n].prop_ptr, "layer", dtoa(xctx->rectcolor) )); + xctx->text[n].layer = xctx->rectcolor; + p = xctx->text[n].prop_ptr; + while(*p) { + if(*p == '\n') *p = ' '; + p++; + } + } + } } if(xctx->lastsel) delete_only_rect_line_arc_poly(); unselect_all(1); diff --git a/src/select.c b/src/select.c index 855ee951..03bd0673 100644 --- a/src/select.c +++ b/src/select.c @@ -193,8 +193,29 @@ void symbol_bbox(int i, double *x1,double *y1, double *x2, double *y2) static void del_rect_line_arc_poly(void) { xRect tmp; - int c, j, i; + int c, j, i, k, itmp, customfont; + double dtmp; + for(k=0;klastsel;k++) + { + double xx1, yy1, xx2, yy2; + int n=xctx->sel_array[k].n; + int type=xctx->sel_array[k].type; + if(type==xTEXT && xctx->text[n].sel==SELECTED) { + + #if HAS_CAIRO==1 + customfont = set_text_custom_font(&xctx->text[n]); + #endif + text_bbox(xctx->text[n].txt_ptr, xctx->text[n].xscale, + xctx->text[n].yscale, xctx->text[n].rot,xctx->text[n].flip, xctx->text[n].hcenter, + xctx->text[n].vcenter, xctx->text[n].x0, xctx->text[n].y0, + &xx1,&yy1,&xx2,&yy2, &itmp, &dtmp); + #if HAS_CAIRO==1 + if(customfont) cairo_restore(xctx->cairo_ctx); + #endif + bbox(ADD, xx1, yy1, xx2, yy2 ); + } + } for(c=0;c