Page MenuHomePhabricator

evas_vg_load_svg: Fix colorstop offset parser
ClosedPublic

Authored by jsuya on Mon, Jan 10, 10:15 PM.

Details

Summary

Values different from numbers and percentages should be ignored
and the default values should be applied (zeros).
And set the min and max of the offset value to be 0, 1.
Also, this patch make that the offset is not input in the reverse order.

Test Plan

Test SVG Image

<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" >
    <linearGradient id="grad" x1="0" y1="0" x2="1" y2="1">
        <stop offset="10%" stop-color="white"/>
        <stop offset="0.2" stop-color="red"/>
        <stop offset="30% k" stop-color="blue"/>
        <stop offset="40%" stop-color="yellow"/>
        <stop offset="0.5m" stop-color="red"/>
        <stop offset="0.6 " stop-color="green"/>
        <stop offset="70%m" stop-color="black"/>
        <stop offset="80%" stop-color="white"/>
    </linearGradient>
    <rect x="20" y="20" width="160" height="160" fill="url(#grad)"/>
</svg>

Result

Diff Detail

Repository
rEFL core/efl
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
jsuya created this revision.Mon, Jan 10, 10:15 PM
jsuya requested review of this revision.Mon, Jan 10, 10:15 PM
jsuya edited the test plan for this revision. (Show Details)Mon, Jan 10, 10:16 PM
Hermet accepted this revision.Tue, Jan 11, 6:34 PM
This revision is now accepted and ready to land.Tue, Jan 11, 6:34 PM
This revision was automatically updated to reflect the committed changes.