Closed
Bug 939534
Opened 11 years ago
Closed 11 years ago
Convert the SVG textPath code from gfxPath to Moz2D Path
Categories
(Core :: SVG, defect)
Core
SVG
Tracking
()
RESOLVED
FIXED
mozilla28
People
(Reporter: jwatt, Assigned: jwatt)
References
(Blocks 1 open bug)
Details
(Whiteboard: [qa-])
Attachments
(1 file, 1 obsolete file)
(deleted),
patch
|
heycam
:
review+
|
Details | Diff | Splinter Review |
We need to convert the SVG textPath code from gfxPath to Moz2D Path.
Assignee | ||
Comment 1•11 years ago
|
||
I've not bothered spending time on the old SVG text code since I'm hoping that will just be ripped out soon.
Attachment #833463 -
Flags: review?(cam)
Assignee | ||
Comment 2•11 years ago
|
||
I just noticed the comment in bug 889736 about not wanting to take those patches until after the December uplift. Guess I better fix nsSVGGlyphFrame too then.
Attachment #833463 -
Attachment is obsolete: true
Attachment #833463 -
Flags: review?(cam)
Attachment #8333561 -
Flags: review?(cam)
Comment 3•11 years ago
|
||
Comment on attachment 8333561 [details] [diff] [review]
patch
Review of attachment 8333561 [details] [diff] [review]:
-----------------------------------------------------------------
::: layout/svg/nsSVGGlyphFrame.cpp
@@ +783,5 @@
> + Point normal(-tangent.y, tangent.x); // Unit vector normal to the point.
> + Point offsetFromPath = normal * pos.y;
> + cp[i].pos = ThebesPoint(pt + offsetFromPath) -
> + ThebesPoint(tangent) * halfAdvance;
> + double glyphRotation = atan2(tangent.y, tangent.x);
Use atan2f.
::: layout/svg/nsSVGTextFrame2.cpp
@@ +4808,5 @@
>
> // Position the character on the path at the right angle.
> + Point tangent; // Unit vector tangent to the point we find.
> + Point pt = path->ComputePointAtLength(Float(midx), &tangent);
> + double glyphRotation = atan2(tangent.y, tangent.x);
Use atan2f and make the variable a float (or Float). Either leave the variable with its old name, "angle", or use "rotation". All the variables around here are to do with the glyph, so I don't think it needs to be in the name.
Attachment #8333561 -
Flags: review?(cam) → review+
Assignee | ||
Comment 4•11 years ago
|
||
Assignee | ||
Comment 5•11 years ago
|
||
Hmmmmmmm....switching to atan2f caused a slight difference in the positioning of textPath text, causing some failures on Mochitest 1:
https://tbpl.mozilla.org/?tree=Mozilla-Inbound&rev=4e64c6bb2732
I _think_ that's probably okay so I marked the tests as fuzzy:
https://hg.mozilla.org/integration/mozilla-inbound/rev/67278f262497
However, CC'ing some people so they're aware of this.
Assignee | ||
Comment 6•11 years ago
|
||
The important thing to note being that the switch from double precision float to single precision float can cause us to no longer get nice round integer results when they might be expected.
https://hg.mozilla.org/mozilla-central/rev/fe2eb1dbf2ac
https://hg.mozilla.org/mozilla-central/rev/4e64c6bb2732
https://hg.mozilla.org/mozilla-central/rev/67278f262497
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Updated•11 years ago
|
Whiteboard: [qa-]
You need to log in
before you can comment on or make changes to this bug.
Description
•