contents are placed on inner faces of building, with visibles above surface and others below

This commit is contained in:
2020-08-31 15:52:38 +02:00
parent 643f857dd8
commit 94b9a5452f
4 changed files with 204 additions and 51 deletions
+3 -3
View File
@@ -4,7 +4,7 @@ export default {
deg2rad (deg) {
return deg * (Math.PI / 180)
},
createLabelCanvas (text, fontsize) {
createLabelCanvas (text, fontsize, sizefactore, txtcolor) {
// console.log('createLabelCanvas', this.data.Titre)
const size = fontsize
const borderSize = 5
@@ -19,7 +19,7 @@ export default {
width = Math.max(width, ctx.measureText(lines[i]).width + doubleBorderSize)
}
const height = size * lines.length + doubleBorderSize
this.label_size = { x: width / 21, y: height / 21 }
this.label_size = { x: width / sizefactore, y: height / sizefactore }
ctx.canvas.width = width
ctx.canvas.height = height
@@ -29,7 +29,7 @@ export default {
// ctx.fillStyle = 'red'
// ctx.fillRect(0, 0, width, height)
ctx.fillStyle = 'black'
ctx.fillStyle = txtcolor
for (var j = 0; j < lines.length; j++) {
ctx.fillText(lines[j], borderSize, borderSize + j * size)
}