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
IntermateMedia opened this issue May 4, 2017 · 10 comments
Closed

Vertical align and line break bug since update #79

IntermateMedia opened this issue May 4, 2017 · 10 comments
Assignees
Milestone

Comments

@IntermateMedia
Copy link

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
Copy link

Hi @gitbrent ,

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

@IntermateMedia
Copy link
Author

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

@ZouhaierSebri
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 );`

@IntermateMedia
Copy link
Author

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

@IntermateMedia
Copy link
Author

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

@Szymon-dziewonski
Copy link

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 this to the 1.9.0 milestone Sep 15, 2017
@gitbrent
Copy link
Owner

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
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 !!

@IntermateMedia
Copy link
Author

Awesome @gitbrent, thank you so much!

@gitbrent
Copy link
Owner

@Szymon-dziewonski - thanks!

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

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

3 participants