mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 02:05:07 +02:00
There's a fairly complicated interaction between an SVG gradient's paint transformation and the gradient coordinate transformation required to correctly draw gradient fills. This was especially noticeable when scaling down an SVG, resulting in broken gradient coordinates and graphical glitches. This changes the objectBoundingBox units to immediately map to the bounding box's coordinate system, so we can unify the gradient paint transformation logic and make it a lot simpler. We only need to undo the bounding box offset and apply the paint transformation to fix a lot of gradient fill bugs.
16 lines
570 B
HTML
16 lines
570 B
HTML
<!DOCTYPE html>
|
|
<link rel="match" href="../expected/svg-gradient-paint-transformation-ref.html" />
|
|
<meta name="fuzzy" content="maxDifference=0-1;totalPixels=0-209">
|
|
<svg height="150" width="150" xmlns="http://www.w3.org/2000/svg">
|
|
<style>
|
|
.hi {
|
|
font: bold 70px sans-serif;
|
|
}
|
|
</style>
|
|
<linearGradient id="gradient">
|
|
<stop offset="0%" stop-color="rgba(255, 0, 0, 1)"/>
|
|
<stop offset="100%" stop-color="rgba(0, 255, 0, 1)"/>
|
|
</linearGradient>
|
|
<text x="50" y="50" class="hi" fill="url(#gradient)" transform="rotate(45 50 50)">HI</text>
|
|
</svg>
|