Skip to content

Commit

Permalink
fix small bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
mi-sts committed May 24, 2024
1 parent db9704f commit 59ad3c2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/main/kotlin/solve/rendering/canvas/SceneCanvas.kt
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,10 @@ class SceneCanvas : OpenGLCanvas() {

fun setFramesSelection(framesSelection: List<VisualizationFrame>) {
if (framesSelection.isNotEmpty() && isFirstFramesSelection) {
engineScene?.initializeFramesRenderer()
isFirstFramesSelection = false
if (scene?.layers?.any { it is Layer.PlanesLayer } ?: true) {
engineScene?.initializeFramesRenderer()
}
}

recalculateCameraCornersPositions()
Expand Down Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions src/main/kotlin/solve/scene/model/Scene.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ class Scene(
val layers: List<Layer>
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>()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
)
Expand Down

0 comments on commit 59ad3c2

Please sign in to comment.