[orx-camera] Add propagationCancelled checks
This commit is contained in:
@@ -43,6 +43,7 @@ class Camera2D : Extension, ChangeEvents {
|
||||
rotationCenter = it.position
|
||||
}
|
||||
mouse.dragged.listen {
|
||||
if (!it.propagationCancelled) {
|
||||
when (it.button) {
|
||||
MouseButton.LEFT -> view = buildTransform {
|
||||
translate(it.dragDisplacement)
|
||||
@@ -58,7 +59,9 @@ class Camera2D : Extension, ChangeEvents {
|
||||
}
|
||||
dirty = true
|
||||
}
|
||||
}
|
||||
mouse.scrolled.listen {
|
||||
if (!it.propagationCancelled) {
|
||||
val scaleFactor = 1.0 - it.rotation.y * 0.03
|
||||
view = buildTransform {
|
||||
translate(it.position)
|
||||
@@ -68,6 +71,7 @@ class Camera2D : Extension, ChangeEvents {
|
||||
dirty = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun setup(program: Program) {
|
||||
setupMouseEvents(program.mouse)
|
||||
|
||||
Reference in New Issue
Block a user