Skip to content

Commit

Permalink
codestyle
Browse files Browse the repository at this point in the history
  • Loading branch information
mi-sts committed Dec 1, 2023
1 parent b894606 commit 0eb31af
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/main/kotlin/solve/scene/controller/SceneController.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import solve.scene.model.Scene
import solve.scene.view.SceneView
import solve.utils.ServiceLocator
import solve.utils.ceilToInt
import solve.utils.structures.DoublePoint
import tornadofx.Controller
import tornadofx.onChange
import kotlin.math.max
Expand Down Expand Up @@ -199,7 +198,7 @@ class SceneController : Controller() {
max(
installedMinScale,
sceneWidthProperty.value / ((scene.frameSize.width + SceneView.framesMargin) * columnsNumber) *
SceneCanvas.IdentityFramesSizeScale
SceneCanvas.IdentityFramesSizeScale
),
DefaultMaxScale
)
Expand Down
9 changes: 6 additions & 3 deletions src/main/kotlin/solve/scene/view/SceneView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -81,19 +81,22 @@ class SceneView : View() {
mouseScreenPoint = extrudeEventMousePosition(event)
}
root.setOnMouseDragged { event ->
if (event.button != MouseDragButton)
if (event.button != MouseDragButton) {
return@setOnMouseDragged
}
mouseScreenPoint = extrudeEventMousePosition(event)
canvas.dragTo(mouseScreenPoint)
}
root.setOnMousePressed { event ->
if (event.button != MouseDragButton)
if (event.button != MouseDragButton) {
return@setOnMousePressed
}
canvas.startDragging(mouseScreenPoint)
}
root.setOnMouseReleased { event ->
if (event.button != MouseDragButton)
if (event.button != MouseDragButton) {
return@setOnMouseReleased
}
canvas.stopDragging()
}
root.setOnScroll { event ->
Expand Down

0 comments on commit 0eb31af

Please sign in to comment.