summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e0c38bd)
raw | patch | inline | side by side (parent: e0c38bd)
author | JucaBlues <JucaBlues@users.sourceforge.net> | |
Mon, 29 Dec 2008 11:00:44 +0000 (11:00 +0000) | ||
committer | JucaBlues <JucaBlues@users.sourceforge.net> | |
Mon, 29 Dec 2008 11:00:44 +0000 (11:00 +0000) |
had forgoten previously)
Also fixing a crash reported by prokoudine
Also fixing a crash reported by prokoudine
src/ui/dialog/svg-fonts-dialog.cpp | patch | blob | history |
index 6ef8fa7293491d71d0a9526f4d5b53f640782530..e2a5c196addc1dbdcef828aaa154eadf7e615b73 100644 (file)
if (sel->isEmpty()) return;
Inkscape::XML::Node* node = (Inkscape::XML::Node*) g_slist_nth_data((GSList *)sel->reprList(), 0);
if (!node || !node->matchAttributeName("d")) return;
+ if (!node->attribute("d")) return; //TODO: give a message to the user
Geom::PathVector pathv = sp_svg_read_pathv(node->attribute("d"));
+
//This matrix flips the glyph vertically
Geom::Matrix m(Geom::Coord(1),Geom::Coord(0),Geom::Coord(0),Geom::Coord(-1),Geom::Coord(0),Geom::Coord(0));
pathv*=m;
if (sel->isEmpty()) return;
Inkscape::XML::Node* node = (Inkscape::XML::Node*) g_slist_nth_data((GSList *)sel->reprList(), 0);
if (!node || !node->matchAttributeName("d")) return;
+ if (!node->attribute("d")) return; //TODO: give a message to the user
+
+ Geom::PathVector pathv = sp_svg_read_pathv(node->attribute("d"));
+
+ //This matrix flips the glyph vertically
+ Geom::Matrix m(Geom::Coord(1),Geom::Coord(0),Geom::Coord(0),Geom::Coord(-1),Geom::Coord(0),Geom::Coord(0));
+ pathv*=m;
+ //then we offset it
+ pathv+=Geom::Point(Geom::Coord(0),Geom::Coord(get_selected_spfont()->horiz_adv_x));
SPObject* obj;
for (obj = get_selected_spfont()->children; obj; obj=obj->next){
if (SP_IS_MISSING_GLYPH(obj)){
- obj->repr->setAttribute("d", (char*) node->attribute("d"));
+ obj->repr->setAttribute("d", (char*) sp_svg_write_path (pathv));
sp_document_done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Set glyph curves"));
}
}