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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

X and Y table coordinates with value of zero ignored #411

Closed
tovab opened this issue Oct 2, 2018 · 2 comments
Closed

X and Y table coordinates with value of zero ignored #411

tovab opened this issue Oct 2, 2018 · 2 comments
Assignees
Milestone

Comments

@tovab
Copy link

tovab commented Oct 2, 2018

Hi

Thanks for the great library.

There seems to be a bug when adding a table with coordinates of 0. When an x or y of 0 is set in the options for addTable, the function defaults the coordinate to some other larger number.

This seems to be happening because of this code-line 4994

opt.x          = getSmartParseNumber( (opt.x || (EMU/2)), 'X' );
opt.y          = getSmartParseNumber( (opt.y || EMU), 'Y' );

where the option to the right of the "||" is used when opt.x or opt.y is falsey, including 0. It needs to check for undefined instead of false.

Can you fix this?

Thanks so much

@gitbrent gitbrent self-assigned this Oct 3, 2018
@gitbrent gitbrent added this to the 2.4.0 milestone Oct 3, 2018
@gitbrent gitbrent changed the title Table coordinates The x and y table coordinates with value of zero ignored Oct 3, 2018
@gitbrent gitbrent changed the title The x and y table coordinates with value of zero ignored X and Y table coordinates with value of zero ignored Oct 3, 2018
gitbrent added a commit that referenced this issue Oct 12, 2018
@gitbrent
Copy link
Owner

Hi @tovab ,

Thanks for reporting this issue.

Tables can reside at 0,0 now

screen shot 2018-10-11 at 23 41 49

gitbrent added a commit that referenced this issue Oct 12, 2018
@tovab
Copy link
Author

tovab commented Oct 12, 2018 via email

ericrockey pushed a commit to WeTransfer/PptxGenJS that referenced this issue Mar 24, 2020
ericrockey pushed a commit to WeTransfer/PptxGenJS that referenced this issue Mar 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants