Commit 3a59a7c0 authored by mrbean-bremen's avatar mrbean-bremen
Browse files

Moved text-anchor and baseline-shift attributes to SvgElementStyle.cs

- use GetInheritedAttribute() to correctly handle "Inherit" value
- fixes inheritance of these attributes from groups
- fixes alignment in types-basic-01-f.svg test
parent a7fde10c
Showing with 23 additions and 20 deletions
+23 -20
......@@ -377,9 +377,9 @@ namespace Svg
}
/// <summary>
/// Gets or sets the text anchor.
/// Gets or sets the space handling.
/// </summary>
/// <value>The text anchor.</value>
/// <value>The space handling.</value>
[SvgAttribute("space", SvgAttributeAttribute.XmlNamespace)]
public virtual XmlSpaceHandling SpaceHandling
{
......
......@@ -157,6 +157,26 @@ namespace Svg
set { this.Attributes["shape-rendering"] = value; }
}
/// <summary>
/// Gets or sets the text anchor.
/// </summary>
[SvgAttribute("text-anchor", true)]
public virtual SvgTextAnchor TextAnchor
{
get { return this.Attributes.GetInheritedAttribute<SvgTextAnchor>("text-anchor"); }
set { this.Attributes["text-anchor"] = value; this.IsPathDirty = true; }
}
/// <summary>
/// Specifies dominant-baseline positioning of text.
/// </summary>
[SvgAttribute("baseline-shift", true)]
public virtual string BaselineShift
{
get { return this.Attributes.GetInheritedAttribute<string>("baseline-shift"); }
set { this.Attributes["baseline-shift"] = value; this.IsPathDirty = true; }
}
/// <summary>
/// Indicates which font family is to be used to render the text.
/// </summary>
......
......@@ -38,24 +38,6 @@ namespace Svg
}
}
/// <summary>
/// Gets or sets the text anchor.
/// </summary>
/// <value>The text anchor.</value>
[SvgAttribute("text-anchor", true)]
public virtual SvgTextAnchor TextAnchor
{
get { return (this.Attributes["text-anchor"] == null) ? SvgTextAnchor.Inherit : (SvgTextAnchor)this.Attributes["text-anchor"]; }
set { this.Attributes["text-anchor"] = value; this.IsPathDirty = true; }
}
[SvgAttribute("baseline-shift", true)]
public virtual string BaselineShift
{
get { return this.Attributes["baseline-shift"] as string; }
set { this.Attributes["baseline-shift"] = value; this.IsPathDirty = true; }
}
public override XmlSpaceHandling SpaceHandling
{
get { return base.SpaceHandling; }
......
......@@ -168,6 +168,7 @@ text-tspan-01-b.svg
text-ws-01-t.svg
text-ws-02-t.svg
text-ws-03-t.svg
types-basic-01-f.svg
painting-stroke-02-t.svg
coords-viewattr-04-f.svg
fonts-desc-01-t.svg
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment