mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 11:06:40 +07:00
cropper: fixed empty logo case
This commit is contained in:
parent
34d1b85513
commit
6f21b909c0
6 changed files with 23 additions and 51 deletions
|
@ -264,10 +264,13 @@ function* getCropData({
|
|||
canvas.height = height;
|
||||
const ctx = canvas.getContext('2d');
|
||||
const image = yield imageFetcher(data);
|
||||
const logoImage = yield imageFetcher(LOGOS[logo][1]);
|
||||
|
||||
ctx.drawImage(image, -x, -y);
|
||||
ctx.drawImage(logoImage, width - logoImage.width, height - logoImage.height);
|
||||
|
||||
if (logo && LOGOS[logo][1]) {
|
||||
const logoImage = yield imageFetcher(LOGOS[logo][1]);
|
||||
ctx.drawImage(logoImage, width - logoImage.width, height - logoImage.height);
|
||||
}
|
||||
|
||||
return yield canvas.toDataURL('image/jpeg');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue