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

Colorize removes the text box "Text fitting" attribute #19

Open
clementlize opened this issue Oct 5, 2023 · 2 comments
Open

Colorize removes the text box "Text fitting" attribute #19

clementlize opened this issue Oct 5, 2023 · 2 comments

Comments

@clementlize
Copy link

Hi, thank you for this extension.
I am facing an issue which is not critical but a bit annoying.

In Slides, when I create a text box, I always set the "text fitting" option to "Resize shape to fit text". But whenever I am applying styles from the extension, this properties gets back to "Do not autofit" (which seems to be the default one).

Would it be possible to keep the existing setting when colorizing?
If I have time I'll try to open a MR, but if you want/can do it before I do, don't hesitate 😄

Thank you!

image

@floitsch
Copy link
Collaborator

floitsch commented Oct 5, 2023

I will try to have a look at some point, but so far I have no idea where this is happening.
My guess is, it's somewhere in the boxShape function: https://github.com/code-syntax-addon/code-syntax/blob/master/slides/syntax.ts#L232.
However, there is no explicit call to disabling the autofit functionality.

That said, apparently autofit can also be disabled implicitly. For example setContentAlignment disables it: https://developers.google.com/apps-script/reference/slides/shape#setcontentalignmentcontentalignment

It would be interesting to figure out which call in there is the culprit. If you want to help, maybe try to find a small repro (in a different script to make things easier). Just take the main shape and apply the modifications that code-syntax applies. After that we can try to find a work-around. So far I don't see any way of enabling the Autofit functionality once it's gone. Might be that we are out of luck...

Relevant issues:
https://issuetracker.google.com/issues/191389037
https://issuetracker.google.com/issues/199176586

@clementlize
Copy link
Author

Thanks for the answer. I took a look at the issues on issuetracker, and it seems that the API indeed is not giving us any magic function to work with.
I'm not very familiar with the Slides environment but I'll definitely try to give it a look when I'll have a bit of time :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants