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

Vertical align and line break bug since update #79

Closed
mirkoint opened this Issue May 4, 2017 · 10 comments

Comments

Projects
None yet
4 participants
@mirkoint
Copy link

mirkoint commented May 4, 2017

Hey there,

since the last update options like valign, align and margin don't work anymore for a text element with multiple styles like here:

slide.addText( [ { text: 'Lorem', options: { bold: true, breakLine: true } }, { text: description } ], { x: 0, y: 0, w: 2, h: 2, valign: 'middle', margin: 0 } )

Valign, align and margin will be default this way.

@gitbrent gitbrent self-assigned this May 4, 2017

@ZouhaierSebri

This comment has been minimized.

Copy link

ZouhaierSebri commented Jun 1, 2017

Hi @gitbrent ,

why line 1503 and 1504 commented.
when we remove comment we get the expected result.

@mirkoint

This comment has been minimized.

Copy link
Author

mirkoint commented Jun 16, 2017

@ZouhaierSebri do you mean this one? It makes the valign work again 👍
Any idea how do fix the margin as well?

@ZouhaierSebri

This comment has been minimized.

Copy link

ZouhaierSebri commented Jun 19, 2017

Hi @mirkoint ,
yes but we can ask @gitbrent why those lines are commented.

`textObj.options.bodyProp = ( textObj.options.bodyProp || {} );

textObj.options.bodyProp.anchor = ( textObj.options.valign || slideObj.options.valign );`

@mirkoint

This comment has been minimized.

Copy link
Author

mirkoint commented Jun 19, 2017

But it only vixes the valign. I'm also trying to fix the margin. Any idea @ZouhaierSebri ?

@mirkoint

This comment has been minimized.

Copy link
Author

mirkoint commented Aug 25, 2017

Hey @gitbrent,
when do you think this bug will be fixed? :)
Cheers,
Mirko

@Szymon-dziewonski

This comment has been minimized.

Copy link

Szymon-dziewonski commented Sep 14, 2017

yes I'm signing in to this question too :) where it will be fixed ?

Thanks

gitbrent pushed a commit that referenced this issue Sep 15, 2017

@gitbrent gitbrent added the bug label Sep 15, 2017

@gitbrent gitbrent added this to the 1.9.0 milestone Sep 15, 2017

@gitbrent

This comment has been minimized.

Copy link
Owner

gitbrent commented Sep 15, 2017

Hi @mirkoint @ZouhaierSebri @Szymon-dziewonski ,

Initially, I was vexed by this as having more than 1 align tag in a paragraph was causing issues in PowerPoint 2007, so i was hesitant and didn't to trade one issue for another. After spending months on Charts, i'm glad you all reminded me to re-engage on this one.

Turns out it was just a good old fashioned bug where i was placing a properties tag inside the wrong XML parent tag and it was getting tangled up. I've fixed in the current codebase - both valign and margin behave as intended.

Try it out now and let me know what you think. Example below.

var pptx = new PptxGenJS();
var slide = pptx.addNewSlide();

slide.addText(
  [
    { text:'Text from', options:{ bold:true, breakLine:true } },
    { text:'Issue #79' }
  ],
  { x:0, y:0, w:2, h:2, valign:'middle', margin:0, line:'0088CC', fill:'F1F1F1' }
);

pptx.save('PptxGenJS-Issue79');

screen shot 2017-09-14 at 23 32 29

gitbrent pushed a commit that referenced this issue Sep 15, 2017

@Szymon-dziewonski

This comment has been minimized.

Copy link

Szymon-dziewonski commented Sep 15, 2017

Hello @gitbrent , Thank you for respond, by the way great job, is there any way to donate you few "bucks"? :)
It's working, thanks !!

@mirkoint

This comment has been minimized.

Copy link
Author

mirkoint commented Sep 15, 2017

Awesome @gitbrent, thank you so much!

@gitbrent

This comment has been minimized.

Copy link
Owner

gitbrent commented Sep 15, 2017

@Szymon-dziewonski - thanks!

If you want to support the project, put a link to the GitHub site on your social network. :-)

@gitbrent gitbrent closed this Sep 15, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.