stickers: drawing arrow + text

This commit is contained in:
muerwre 2018-12-06 09:20:55 +07:00
parent f183c8593d
commit 9729a9e117
11 changed files with 120 additions and 25 deletions

View file

@ -20,9 +20,9 @@ import { DEFAULT_USER } from '$constants/auth';
import { TIPS } from '$constants/tips';
import {
composeImages,
composePoly, downloadCanvas,
composePoly, composeStickers, downloadCanvas,
fetchImages,
getPolyPlacement,
getPolyPlacement, getStickersPlacement,
getTilePlacement,
imageFetcher
} from '$utils/renderer';
@ -259,12 +259,15 @@ function* getRenderData() {
const geometry = getTilePlacement();
const points = getPolyPlacement();
const stickers = getStickersPlacement();
ctx.clearRect(0, 0, canvas.width, canvas.height);
const images = yield fetchImages(ctx, geometry);
yield composeImages({ geometry, images, ctx });
yield composePoly({ points, ctx });
yield composeStickers({ stickers, ctx });
return yield canvas.toDataURL('image/jpeg');
}