Skip to content

Commit

Permalink
fix photo view text position
Browse files Browse the repository at this point in the history
  • Loading branch information
halamix2 committed Aug 6, 2024
1 parent ae0ccc2 commit f158d0b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/views/PhotoView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ const routeQuery = useRoute().query,
}
const ctx = mainCanvas.value.getContext('2d')!,
runnerPosition = 208 + 101,
titleLength = ctx.measureText(title.value).width,
subtitleLength = ctx.measureText(subtitle.value).width,
titlesDiff = Math.abs(titleLength - subtitleLength),
titleMiddle = canvasWidth.value / 2,
fullTitle = `${title.value} ${subtitle.value}`
ctx.drawImage(imageGradient, 0, 0)
Expand Down Expand Up @@ -93,7 +89,11 @@ const routeQuery = useRoute().query,
ctx.font = `normal normal 600 ${titleFontSize.toString()}px Saira Condensed`
}
const titleHeight = 442 + titleFontSize / 2
const titleHeight = 442 + titleFontSize / 2,
titleLength = ctx.measureText(title.value).width,
subtitleLength = ctx.measureText(subtitle.value).width,
titlesDiff = Math.abs(titleLength - subtitleLength),
titleMiddle = canvasWidth.value / 2
let titlePosition = titleMiddle - titleLength / 2 + titlesDiff / 2,
subtitlePosition = titleMiddle + subtitleLength / 2 + titlesDiff / 2
Expand Down

0 comments on commit f158d0b

Please sign in to comment.