The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

Ignore case in gradient URL

These changes was commited to the Birdfont repository Sun, 06 Mar 2016 11:41:40 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
author Johan Mattsson <johan.mattsson.m@gmail.com>
Sun, 06 Mar 2016 11:41:40 +0000 (12:41 +0100)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Sun, 06 Mar 2016 11:42:05 +0000 (12:42 +0100)
commit 2a621eec02ac3e21b425fe0860cc950351452f48
tree e333df5cc53bdd1ae194f3c71bb5de056fc067c3
parent aefe57f50b32df890dd118a91a393ebbfa441711
Ignore case in gradient URL

Inkscape requires this.

libbirdfont/MoveTool.vala
libsvgbird/Defs.vala
libsvgbird/SvgDrawing.vala
libsvgbird/SvgStyle.vala
--- a/libbirdfont/MoveTool.vala +++ b/libbirdfont/MoveTool.vala @@ -286,22 +286,22 @@ if (o is PathObject) { Path p = ((PathObject) o).get_path (); p.update_region_boundaries (); - - if (px > p.xmin) { - px = p.xmin; - } + } + + if (px > o.xmin) { + px = o.xmin; + } - if (py > p.ymin) { - py = p.ymin; - } + if (py > o.ymin) { + py = o.ymin; + } - if (px2 < p.xmax) { - px2 = p.xmax; - } - - if (py2 < p.ymax) { - py2 = p.ymax; - } + if (px2 < o.xmax) { + px2 = o.xmax; + } + + if (py2 < o.ymax) { + py2 = o.ymax; } }
--- a/libsvgbird/Defs.vala +++ b/libsvgbird/Defs.vala @@ -92,11 +92,13 @@ } else { tag_id = id; } + + tag_id = tag_id.down (); foreach (Gradient gradient in gradients) { - if (gradient.id == tag_id) { + if (gradient.id.down () == tag_id) { return gradient; - } + } } return null;
--- a/libsvgbird/SvgDrawing.vala +++ b/libsvgbird/SvgDrawing.vala @@ -35,11 +35,47 @@ svg_width = value; } } + public double svg_width = 0; - public double height = 0; + + public override double xmin { + get { + return x; + } + + set { + } + } + + public override double xmax { + get { + return x + width; + } + + set { + } + } + + public override double ymin { + get { + return y; + } + + set { + } + } + + public override double ymax { + get { + return y + height; + } + set { + } + } + public override void update_region_boundaries () { }
--- a/libsvgbird/SvgStyle.vala +++ b/libsvgbird/SvgStyle.vala @@ -228,8 +228,10 @@ if (d != null) { Defs defs = (!) d; + print (s.style.get ("fill") + "\n"); + s.stroke_gradient = defs.get_gradient_for_url (s.style.get ("stroke")); - s.fill_gradient = defs.get_gradient_for_url (s.style.get ("fill")); + s.fill_gradient = defs.get_gradient_for_url (s.style.get ("fill")); } if (s.fill != null) {