diff --git a/.idea/deploymentTargetDropDown.xml b/.idea/deploymentTargetDropDown.xml index df0740d..82a483a 100644 --- a/.idea/deploymentTargetDropDown.xml +++ b/.idea/deploymentTargetDropDown.xml @@ -1,17 +1,17 @@ - + - + - - + + - - + + \ No newline at end of file diff --git a/app/src/main/java/com/example/acapendulum20/canvas/CanvasPendulum.kt b/app/src/main/java/com/example/acapendulum20/canvas/CanvasPendulum.kt index 167060a..2aeb786 100644 --- a/app/src/main/java/com/example/acapendulum20/canvas/CanvasPendulum.kt +++ b/app/src/main/java/com/example/acapendulum20/canvas/CanvasPendulum.kt @@ -89,7 +89,7 @@ class CanvasPendulum @JvmOverloads constructor( var gravity = 0.981f var damping = 0.996f - if (mPendulum.stopPosition.x > canvas.width / 4.toFloat() && mPendulum.stopPosition.x <= canvas.width * 0.75.toFloat()) { + if (mPendulum.stopPosition.x > canvas.width / 4f && mPendulum.stopPosition.x <= canvas.width * 0.75f) { gravity = 1.981f if (mPendulum.stopPosition.x > canvas.width / 3.toFloat() && mPendulum.stopPosition.x <= canvas.width / 1.5.toFloat()) { @@ -128,18 +128,13 @@ class CanvasPendulum @JvmOverloads constructor( //Origin transition mPendulum.stopPosition.x += mPendulum.startPosition.x } - } fun startMagnet(magnet: Boolean) { - //println("startMagnet") - //println(magnet) mPendulum.magneticField = magnet } fun stopMagnet(magnet: Boolean) { - //println("stopMagnet") - //println(magnet) mPendulum.magneticField = magnet }