作図ソフト dia の改良版
Revisión | 3f1eb324ef01fb0e27eda5883090bd8355b73382 (tree) |
---|---|
Tiempo | 2007-03-29 04:49:06 |
Autor | Lars Clausen <lclausen@src....> |
Commiter | Lars Clausen |
Branch for fixes after 0.96
svn path=/branches/dia_0_96/; revision=3656
@@ -977,14 +977,13 @@ custom_update_data(Custom *custom, AnchorShape horiz, AnchorShape vert) | ||
977 | 977 | txs = text_get_string_copy(custom->text); |
978 | 978 | |
979 | 979 | if ((tb.bottom+tb.top)/2 > elem->corner.y + elem->height) |
980 | - p.y = tb.top + | |
981 | - dia_font_ascent(txs,custom->text->font, custom->text->height); | |
980 | + p.y = tb.top + text_get_ascent(custom->text); | |
982 | 981 | else if ((tb.bottom+tb.top)/2 < elem->corner.y) |
983 | 982 | p.y = tb.bottom + custom->text->height * (custom->text->numlines - 1); |
984 | 983 | else |
985 | 984 | p.y = (tb.top + tb.bottom - |
986 | 985 | custom->text->height * custom->text->numlines) / 2 + |
987 | - dia_font_ascent(txs,custom->text->font, custom->text->height); | |
986 | + text_get_ascent(custom->text); | |
988 | 987 | text_set_position(custom->text, &p); |
989 | 988 | g_free(txs); |
990 | 989 | } |
@@ -1190,16 +1189,13 @@ void custom_reposition_text(Custom *custom, GraphicElementText *text) { | ||
1190 | 1189 | /* align the text to be close to the shape ... */ |
1191 | 1190 | |
1192 | 1191 | if ((tb.bottom+tb.top)/2 > elem->corner.y + elem->height) |
1193 | - p.y = tb.top + | |
1194 | - dia_font_ascent(text->string, | |
1195 | - text->object->font, text->object->height); | |
1192 | + p.y = tb.top + text_get_ascent(text->object); | |
1196 | 1193 | else if ((tb.bottom+tb.top)/2 < elem->corner.y) |
1197 | 1194 | p.y = tb.bottom + text->object->height * (text->object->numlines - 1); |
1198 | 1195 | else |
1199 | 1196 | p.y = (tb.top + tb.bottom - |
1200 | 1197 | text->object->height * text->object->numlines) / 2 + |
1201 | - dia_font_ascent(text->string, | |
1202 | - text->object->font, text->object->height); | |
1198 | + text_get_ascent(text->object); | |
1203 | 1199 | text_set_position(text->object, &p); |
1204 | 1200 | return; |
1205 | 1201 | } |