Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Less limited text-anchor attribute handling. #25

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,12 @@ public class TSpanNodeRendererIntegrationTest : SvgIntegrationTest {
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "textspan-textAnchor");
}

//Text-anchor test using transform attribute for X position
[NUnit.Framework.Test]
public virtual void TSpanTextAnchorTransformFunctionalTest() {
ConvertAndCompare(SOURCE_FOLDER, DESTINATION_FOLDER, "textspan-textAnchor-transform");
}

[NUnit.Framework.Test]
//TODO: update after DEVSIX-2507 and DEVSIX-3005 fix
[LogMessage(iText.StyledXmlParser.Logs.StyledXmlParserLogMessageConstant.UNKNOWN_ABSOLUTE_METRIC_LENGTH_PARSED
Expand Down
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -411,15 +411,11 @@ public class TextSvgBranchRenderer : AbstractSvgNodeRenderer, ISvgTextNodeRender
String textAnchorValue = this.GetAttribute(SvgConstants.Attributes.TEXT_ANCHOR);
// Middle
if (SvgConstants.Values.TEXT_ANCHOR_MIDDLE.Equals(textAnchorValue)) {
if (xPos != null && xPos.Length > 0) {
textAnchorXCorrection -= childContentLength / 2;
}
textAnchorXCorrection -= childContentLength / 2;
}
// End
if (SvgConstants.Values.TEXT_ANCHOR_END.Equals(textAnchorValue)) {
if (xPos != null && xPos.Length > 0) {
textAnchorXCorrection -= childContentLength;
}
textAnchorXCorrection -= childContentLength;
}
}
return textAnchorXCorrection;
Expand Down