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

PNG and Null error #2

Open
JoshuaLowe1002 opened this issue May 3, 2020 · 4 comments
Open

PNG and Null error #2

JoshuaLowe1002 opened this issue May 3, 2020 · 4 comments

Comments

@JoshuaLowe1002
Copy link

@51lv3str1

Great work!!

I'm wondering if you have an example where it gets exported to PNG rather than SVG?

Also on my beta.app.edublocks.org for some reason Blockly.Css.CONTENT is null :(

@asanzo
Copy link
Contributor

asanzo commented May 4, 2020

¡Hi Joshua!

Regarding to PNG export, I've just added that to this script. In the bottom of the script you can choose if to exportSVG() or exportPNG() (uncomment the line you want to use)

Regarding to Blockly.Css.CONTENT, I've just run this script (blockly-to-svg) in your page beta.app.edublocks.com (great page, by the way) and it exports the SVG fine. That variable is not null.

Can you tell us more about your problem?

@JoshuaLowe1002
Copy link
Author

Thanks so much for this. Amazing work.
I’ll try it out later today.

Yes, that bug is now fixed. There was a line I had to comment out on blockly. In newer versions the css contents in that function get wiped

@JoshuaLowe1002
Copy link
Author

Great work @asanzo I have tried it today but have a few questions.
It seems to limit the size here and cut things off, do you know why?
One last question is, how do I get the dropdown arrows to show on the final image?
Thanks once again!
image

@asanzo
Copy link
Contributor

asanzo commented May 5, 2020

Hi, again Joshua!!
In the script, you have to tweak canvas size:

Where it says:

var canvas = document.createElement('canvas');

you can add:

var canvas = document.createElement('canvas');
canvas.width = 800;
canvas.height = 600;

So you can choose canvas size. I have added that to the code.

Regarding to the dropdown arrows, sorry but I don't have a clue why in that page they don't show.

I've opened an issue to deal with it:
#3

We don't know when we'll be able to correct it as we have lots of work :)

If you're ok with it, we can close this issue.

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