[Webkit-unassigned] [Bug 92868] [css3-text] Add platform support for "wavy" text decoration style

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Mar 27 16:01:49 PDT 2013


https://bugs.webkit.org/show_bug.cgi?id=92868





--- Comment #74 from Lamarque V. Souza <Lamarque.Souza at basyskom.com>  2013-03-27 15:59:58 PST ---
(From update of attachment 194941)
View in context: https://bugs.webkit.org/attachment.cgi?id=194941&action=review

>> Source/WebCore/rendering/InlineTextBox.cpp:1044
>> +        // Make sure (x1, y1) < (x2, y2).
> 
> This only make sure y1 <= y2.
> I would just remove the comment.

I meant "Make sure point (x1, y1) is at left of point (x2, y2)". I will remove the comment.

>> Source/WebCore/rendering/InlineTextBox.cpp:1062
>> +        step += adjustment;
> 
> This whole block should be a static function.
> 
> Looks like you should use unsigned instead of int.
> 
> Why do you switch to integer at all for the step?
> Why do you use -1 for the length?
> 
> I would think something like that would be better:
> float length = y2 - y1.
> unsigned stepCount = static_cast<unsigned>(length / step);
> float uncoveredLength = length - (stepCount * step);
> float adjustment = uncoveredLength / stepCount;
> step += adjustment;

I used a module operator (%), I was not sure it if would work with float. Anyway, your suggestion does not need that operation so the casting is not necessary. I just fixed a small issue when calculating the covered lenght. Since one Bezier curve starts at the same pixels as the previous one ended we need to subtract (stepCount - 1) pixels from the covered lenght. The second line becomes "float uncoveredLength = length - (stepCount * step - (stepCount -1));". Without the -1 the last Bezier curve was not draw sometimes because the decoration crossed the x2 coordinate (for horizontal wavy decoration). Now everything works as it should and the -1 can be removed.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list