Improved shape example

This commit is contained in:
Devine Lu Linvega
2019-08-01 15:43:24 +09:00
parent 12bacf0551
commit 580a4721b2
10 changed files with 31 additions and 35 deletions

View File

@@ -37,7 +37,7 @@ function Surface (ronin) {
if (isText(shape)) {
context.textAlign = shape.a
context.font = `${shape.p}px ${shape.f}`
context.strokeText(shape.t, shape.x, shape.y)
context.strokeText(`${shape.t}`, shape.x, shape.y)
} else if (isSvg(shape)) {
context.lineWidth = width
context.save()
@@ -59,7 +59,7 @@ function Surface (ronin) {
if (isText(shape)) {
context.textAlign = shape.a
context.font = `${shape.p}px ${shape.f}`
context.fillText(shape.t, shape.x, shape.y)
context.fillText(`${shape.t}`, shape.x, shape.y)
} else if (isSvg(shape)) {
context.save()
context.translate(shape.x, shape.y)