Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix duplicate adjustment in SVG path command T #30

Merged
merged 1 commit into from
Oct 3, 2023

Conversation

ralfstx
Copy link

@ralfstx ralfstx commented Oct 2, 2023

The control point (px, py) is already updated in the else branch above (L271). It is then updated once again which causes Hopding#1443

This commit removes these duplicated lines which fixes the bug.

What?

Fixes Hopding#1443

Why?

Because we're making the world a better place.

How?

See code. Removed two lines of code which were clearly wrong.

Testing?

I've come across this issue cheating when I implemented SVG path support in PDF Maker.

As explained in the bug mentioned above, with this path: M 10,25 Q 30,0 50,25 Q 70,50 90,25 T 130,25 T 170,25, the green line in the image below should be rendered, but the red line actually is.

To reprocude, try drawSvgPath('M 10,25 Q 30,0 50,25 Q 70,50 90,25 T 130,25 T 170,25')

New Dependencies?

No.

Screenshots

image

Suggested Reading?

Unrelated, but yes, I've read most of the PDF 1.7 spec 馃

Anything Else?

Thanks for keeping this project alive, guys! 鉂わ笍

Checklist

  • I read CONTRIBUTING.md.
    TLDR, sorry
  • I read MAINTAINERSHIP.md#pull-requests.
  • I added/updated unit tests for my changes.
  • I added/updated integration tests for my changes.
  • I ran the integration tests.
  • I tested my changes in Node, Deno, and the browser.
  • I viewed documents produced with my changes in Adobe Acrobat, Foxit Reader, Firefox, and Chrome.
  • I added/updated doc comments for any new/modified public APIs.
  • My changes work for both new and existing PDF files.
  • I ran the linter on my changes.
    Sorry, I'm not a yarn guy. But your CI checks that, doesn't it?

The control point (`px`, `py`) is already updated in the else branch
above (L271). It is then updated once again which causes
Hopding#1443

This commit removes these duplicated lines which fixes the bug.
@Sharcoux Sharcoux merged commit da86090 into cantoo-scribe:master Oct 3, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SVG path command T does not update the control point correctly
2 participants