canvg
canvg copied to clipboard
Cater transform on clipPath element
transform
attribute is allowed on <clipPath>
element and should be honored.
<svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
<defs>
<style>
.circle{clip-path: url(#clip-path);}
</style>
<clipPath id="clip-path" transform="translate(50)">
<circle cx="50" cy="50" r="50" />
</clipPath>
</defs>
<rect width="100" height="100" fill="red" class="circle" />
</svg>
Incorrect result before fix:
Correct result after fix:
this looks fine just needs a test! the best way to do that:
- add your svg example to
test/svgs/issueXXXX.svg
- add to bottom of
test/svgs.json
giving it a name - add as option to
test/browser/index.html
, giving it the same name - make commit with [ci update snapshots] in message
- wait when new snapshots will generated
- download new snapshots from artifacts
https://github.com/canvg/canvg/actions/runs/XXXX
- make commit with new snapshots placing them in
test/__image_snapshots__/
(there should be 3: browser/node/offscreen)
@dangreen what's the correct way to trigger snapshots these days?
@gabelerner commit message should contain [ci update snapshots]
@gabelerner commit message should contain
[ci update snapshots]
@dangreen Had already [ci update snapshots]
in the message, but once added a new entry in test/svgs.json, it had the following error:
New snapshot was not written. The update flag must be explicitly passed to write a new snapshot.
Otherwise snapshots are created and can be download through artifects.
i think this should pass @takerusilt , can you push up an empty commit to retrigger the builds?
git commit --allow-empty -m "trigger GitHub actions"
git push