Commit 24d72357 authored by rwlbuis@webkit.org's avatar rwlbuis@webkit.org

2011-03-27 Rob Buis <rwlbuis@gmail.com>

        Reviewed by Nikolas Zimmermann.

        Text on path positioning at zero startOffset
        https://bugs.webkit.org/show_bug.cgi?id=56245

        Since for length 0 no previous point is set, choose epsilon
        length to get normal at starting point of the path.

        Test: svg/text/text-path-middle-align.svg

        * platform/graphics/Path.cpp:
        (WebCore::Path::normalAngleAtLength):

git-svn-id: svn://svn.chromium.org/blink/trunk@82061 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 07efa2f3
2011-03-27 Rob Buis <rwlbuis@gmail.com>
Reviewed by Nikolas Zimmermann.
Text on path positioning at zero startOffset
https://bugs.webkit.org/show_bug.cgi?id=56245
* platform/mac/svg/text/text-path-middle-align-expected.checksum: Added.
* platform/mac/svg/text/text-path-middle-align-expected.png: Added.
* platform/mac/svg/text/text-path-middle-align-expected.txt: Added.
* svg/text/text-path-middle-align.svg: Added.
2011-03-26 Dan Bernstein <mitz@apple.com>
Reviewed by Maciej Stachowiak.
......
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderSVGRoot {svg} at (149,127) size 202x224
RenderSVGPath {path} at (149,149) size 202x202 [stroke={[type=SOLID] [color=#000000]}] [data="M 250 150 C 305.228 150 350 194.772 350 250 C 350 305.228 305.228 350 250 350 C 194.772 350 150 305.228 150 250 C 150 194.772 194.772 150 250 150"]
RenderSVGText {text} at (239,127) size 22x30 contains 1 chunk(s)
RenderSVGTextPath {textPath} at (0,0) size 22x30
RenderSVGInlineText {#text} at (0,0) size 22x30
chunk 1 (middle anchor) text run 1 at (250.00,150.00) startOffset 0 endOffset 1 width 21.00: "M"
RenderSVGInlineText {#text} at (0,0) size 0x0
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<path id="circle" d="M250 150C305.228 150 350 194.772 350 250C350 305.228 305.228 350 250 350C194.772 350 150 305.228 150 250C150 194.772 194.772 150 250 150" fill="none" stroke="black"/>
<text>
<textPath xlink:href="#circle" startOffset="0%" font-size="18pt" fill="red" text-anchor="middle">M</textPath>
</text>
</svg>
2011-03-27 Rob Buis <rwlbuis@gmail.com>
Reviewed by Nikolas Zimmermann.
Text on path positioning at zero startOffset
https://bugs.webkit.org/show_bug.cgi?id=56245
Since for length 0 no previous point is set, choose epsilon
length to get normal at starting point of the path.
Test: svg/text/text-path-middle-align.svg
* platform/graphics/Path.cpp:
(WebCore::Path::normalAngleAtLength):
2011-03-27 Ben Taylor <bentaylor.solx86@gmail.com>
Reviewed by Oliver Hunt.
......@@ -102,7 +102,7 @@ FloatPoint Path::pointAtLength(float length, bool& ok) const
float Path::normalAngleAtLength(float length, bool& ok) const
{
PathTraversalState traversalState(PathTraversalState::TraversalNormalAngleAtLength);
traversalState.m_desiredLength = length;
traversalState.m_desiredLength = length ? length : std::numeric_limits<float>::epsilon();
apply(&traversalState, pathLengthApplierFunction);
ok = traversalState.m_success;
return traversalState.m_normalAngle;
......
Markdown is supported
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