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

Graphics.createImage : Same result with different strings #2296

Closed
rchateauneu opened this issue Nov 26, 2022 · 1 comment
Closed

Graphics.createImage : Same result with different strings #2296

rchateauneu opened this issue Nov 26, 2022 · 1 comment

Comments

@rchateauneu
Copy link

These two calls to Graphics.createImage create the same ArrayBuffer:

var img = Graphics.createImage(`


 1

 1

`);
={ width: 2, height: 3,  buffer: "\4" }

var img = Graphics.createImage(`


 1



`);
={ width: 2, height: 1,  buffer: "\4" }

On top of this, it would be very convenient to, optionaly, not eliminate empty lines at the beginning and end of the input buffer : It is convenient to set the total size of the image, even of the borders are set to zero.

@gfwilliams
Copy link
Member

Sorry for the delay - just fixed this.

The idea was that you could use empty lines at the beginning and end... It would discount just the first and last newline in the image, not other empty lines (so it was just a bit broken).

In your examples above it'd give you a 2x6 image in each case.

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