From 59ad3c24115e429d066978d5159573e489762507 Mon Sep 17 00:00:00 2001 From: Stanislav Mishchenko Date: Fri, 24 May 2024 20:30:41 +0300 Subject: [PATCH] fix small bugs --- src/main/kotlin/solve/rendering/canvas/SceneCanvas.kt | 6 ++++-- src/main/kotlin/solve/scene/model/Scene.kt | 6 ++++-- .../fields/view/VisualizationSettingsLayerCell.kt | 5 ++++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/main/kotlin/solve/rendering/canvas/SceneCanvas.kt b/src/main/kotlin/solve/rendering/canvas/SceneCanvas.kt index cdd66cba..f5d833ee 100644 --- a/src/main/kotlin/solve/rendering/canvas/SceneCanvas.kt +++ b/src/main/kotlin/solve/rendering/canvas/SceneCanvas.kt @@ -91,8 +91,10 @@ class SceneCanvas : OpenGLCanvas() { fun setFramesSelection(framesSelection: List) { if (framesSelection.isNotEmpty() && isFirstFramesSelection) { - engineScene?.initializeFramesRenderer() isFirstFramesSelection = false + if (scene?.layers?.any { it is Layer.PlanesLayer } ?: true) { + engineScene?.initializeFramesRenderer() + } } recalculateCameraCornersPositions() @@ -427,7 +429,7 @@ class SceneCanvas : OpenGLCanvas() { } companion object { - const val IdentityFramesSizeScale = 1.6f + const val IdentityFramesSizeScale = 1.605f private val landmarkInteractionMouseButton = MouseButton.Left private val contextMenuMouseButton = MouseButton.Right diff --git a/src/main/kotlin/solve/scene/model/Scene.kt b/src/main/kotlin/solve/scene/model/Scene.kt index 53569874..0bc5de1c 100644 --- a/src/main/kotlin/solve/scene/model/Scene.kt +++ b/src/main/kotlin/solve/scene/model/Scene.kt @@ -28,10 +28,12 @@ class Scene( val layers: List get() = frames.firstOrNull()?.layers ?: emptyList() - private val planesLayersStorage = layerSettings.filter { it is LayerSettings.PlaneLayerSettings }.toMutableList() + private val planesLayersStorage = layerSettings.filter { + it is LayerSettings.PlaneLayerSettings + }.reversed().toMutableList() private val nonPlanesLayersStorage = layerSettings.filterNot { it is LayerSettings.PlaneLayerSettings - }.toMutableList() + }.reversed().toMutableList() private val changedCallbacks = mutableListOf<() -> Unit>() diff --git a/src/main/kotlin/solve/settings/visualization/fields/view/VisualizationSettingsLayerCell.kt b/src/main/kotlin/solve/settings/visualization/fields/view/VisualizationSettingsLayerCell.kt index 2a116a90..67e821c5 100644 --- a/src/main/kotlin/solve/settings/visualization/fields/view/VisualizationSettingsLayerCell.kt +++ b/src/main/kotlin/solve/settings/visualization/fields/view/VisualizationSettingsLayerCell.kt @@ -118,7 +118,10 @@ class VisualizationSettingsLayerCell( ) { if (droppedItemInfo != null && !isAbleToDropItem(thisItemInfo.item, droppedItemInfo.item)) { val hintPopOver = PopOver( - label("Plane and non-plane layers cannot be swapped!") { + label( + "Plane and non-plane layers cannot be " + + "swapped!" + ) { padding = Insets(0.0, 10.0, 0.0, 10.0) } )