Skip to content

Commit

Permalink
refactor: Changes in new Android build version
Browse files Browse the repository at this point in the history
  • Loading branch information
itachi1706 committed May 17, 2024
1 parent ae19971 commit c27b4c4
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,10 @@ class ClueView(context: Context) : View(context) {
setBackgroundColor(if (correct) correctColor else incorrectColor)
return correct
}
override fun onDraw(canvas: Canvas?) {
override fun onDraw(canvas: Canvas) {
super.onDraw(canvas)
if (!showText) return
canvas?.let {
canvas.let {
val x = canvas.width / 2f
val y = canvas.height / 2f
var textWidth = canvas.width
Expand All @@ -260,7 +260,7 @@ class ClueView(context: Context) : View(context) {
textWidth = canvas.height
}
val textLayout = StaticLayout.Builder.obtain(
text, 0, text.length, paint, textWidth).build()
text, 0, text.length, paint, textWidth).build()
canvas.translate(x, y - textLayout.height / 2)
textLayout.draw(canvas)
}
Expand Down

0 comments on commit c27b4c4

Please sign in to comment.