• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

作図ソフト dia の改良版


Commit MetaInfo

Revisione59b01e9d90ba0556dfb04de205c6830870bedfd (tree)
Time2014-10-10 03:01:14
AuthorHans Breuer <hans@breu...>
CommiterHans Breuer

Log Message

[transform] svg: import transformation from <text transform="...">

With the last commit implementing "Standard - Text"::transform() text
transformation is much easier and more correct.

Change Summary

Incremental Difference

--- a/plug-ins/svg/svg-import.c
+++ b/plug-ins/svg/svg-import.c
@@ -785,8 +785,6 @@ read_text_svg(xmlNodePtr node, DiaSvgStyle *parent_style,
785785 multiline = NULL;
786786 }
787787 if(str || multiline) {
788- if (matrix)
789- transform_point (&point, matrix);
790788 new_obj = otype->ops->create(&point, otype->default_user_data,
791789 &h1, &h2);
792790 list = g_list_append (list, new_obj);
@@ -813,13 +811,8 @@ read_text_svg(xmlNodePtr node, DiaSvgStyle *parent_style,
813811 /* font-size should be the line-height according to SVG spec,
814812 * but see node_set_text_style() - round-trip first */
815813 real font_scale = dia_font_get_height (prop->attr.font) / dia_font_get_size (prop->attr.font);
816- if (matrix) /* ToDo: more text transform - or not at all? */
817- transform_length (&font_height, matrix);
818814 prop->attr.height = font_height * font_scale;
819815 } else {
820- real fh = gs->font_height;
821- if (matrix)
822- transform_length (&fh, matrix);
823816 prop->attr.height = gs->font_height;
824817 }
825818 /* when operating with default values foreground and background are intentionally swapped
@@ -843,6 +836,10 @@ read_text_svg(xmlNodePtr node, DiaSvgStyle *parent_style,
843836 }
844837 new_obj->ops->set_props(new_obj, props);
845838 prop_list_free(props);
839+ if (matrix) {
840+ g_return_val_if_fail (new_obj->ops->transform, list);
841+ new_obj->ops->transform(new_obj, matrix);
842+ }
846843 }
847844 if (gs->font)
848845 dia_font_unref (gs->font);