Re: Problem with user-created shapes with <svg:text>



This was driving me nuts, so I dug through the code some more and was able to
come up with a temporary solution.

In "objects/custom/custom_object.c" I reused a portion of code from the
"custom_create" function in the "custom_load" function.  Here's the diff:

1363d1362
<   GList *tmp;
1440,1452d1438
<     }
<   }
<   for (tmp = custom->info->display_list; tmp != NULL; tmp = tmp->next) {
<     GraphicElement *el = tmp->data;
<     if (el->type == GE_TEXT) {
<       if (!el->text.s.font_height) el->text.s.font_height = FONT_HEIGHT_DEFAULT;
<       if (!el->text.s.font) el->text.s.font = font_getfont(_(FONT_DEFAULT));
<       if (el->text.s.alignment == -1) el->text.s.alignment = TEXT_ALIGNMENT_DEFAULT;
<       if (!el->text.object ) {
<         el->text.object = new_text(el->text.string, el->text.s.font, el->text.s.font_height,
<                                    &el->text.anchor, &color_black, el->text.s.alignment);
<         text_calc_boundingbox(el->text.object, &el->text.text_bounds);
<       }

I call this a temporary solution because Dia still seg faults when you close
the diagram, but you can open/save it just fine now.  I'm just trying to help
point one of the real maintainers towards the right area.

Scott



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]