Move stuff into base
This commit is contained in:
@@ -40,9 +40,7 @@ class PhysicalStringView(
|
||||
}
|
||||
|
||||
private fun onAnimationFrame(time: Double) {
|
||||
if (MainView.started) {
|
||||
draw()
|
||||
}
|
||||
draw()
|
||||
|
||||
window.requestAnimationFrame(::onAnimationFrame)
|
||||
}
|
||||
@@ -89,7 +87,7 @@ class PhysicalStringView(
|
||||
|
||||
private fun draw() {
|
||||
val ctx = context
|
||||
if (ctx != null) {
|
||||
if (ctx != null && ctx.canvas.isConnected) {
|
||||
val width = ctx.canvas.width.toDouble()
|
||||
val height = ctx.canvas.height.toDouble()
|
||||
val halfHeight = height / 2.0
|
||||
|
||||
Reference in New Issue
Block a user