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

black imege background when set custom size #318

Open
Mateusz86 opened this issue May 4, 2017 · 0 comments
Open

black imege background when set custom size #318

Mateusz86 opened this issue May 4, 2017 · 0 comments

Comments

@Mateusz86
Copy link

for exaple on initial i set
viewport: { width: 200, height: 100, type: 'square' },

and result
result({ type:"base64", format:'jpg', backgroundColor : "#ffffff", size:{ width:400, height:200 }
When image is drag away outside viewport i get black image 400x200px in white rectangle 200x100

To improve to the code function _getCanvas
Instead of
if (data.backgroundColor) { ctx.fillStyle = data.backgroundColor; ctx.fillRect(0, 0, outWidth, outHeight); }

should be changed to
if (data.backgroundColor) { ctx.fillStyle = data.backgroundColor; ctx.fillRect(0, 0, canvas.width, canvas.height); }

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

1 participant