From 46c542e8f6cf9ff359051b8e8054f4c0916b7b72 Mon Sep 17 00:00:00 2001 From: Octol1ttle Date: Wed, 12 Feb 2025 13:52:05 +0500 Subject: [PATCH] fix: don't use red arrow color when the limiting input is not active --- .../flightassistant/impl/display/AttitudeDisplay.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/ru/octol1ttle/flightassistant/impl/display/AttitudeDisplay.kt b/src/main/kotlin/ru/octol1ttle/flightassistant/impl/display/AttitudeDisplay.kt index 17ed818..81b4442 100644 --- a/src/main/kotlin/ru/octol1ttle/flightassistant/impl/display/AttitudeDisplay.kt +++ b/src/main/kotlin/ru/octol1ttle/flightassistant/impl/display/AttitudeDisplay.kt @@ -95,7 +95,7 @@ class AttitudeDisplay(computers: ComputerView) : Display(computers) { matrices.translate(centerXI, y, 0) // Rotate around the middle of the arrow matrices.multiply(RotationAxis.NEGATIVE_Z.rotationDegrees(180.0f)) // Flip upside down - drawMiddleAlignedText(arrowText, -1, 0, if (maxInput?.active != false) warningColor else cautionColor) + drawMiddleAlignedText(arrowText, -1, 0, if (maxInput?.active == true) warningColor else cautionColor) matrices.pop() max += step @@ -104,7 +104,7 @@ class AttitudeDisplay(computers: ComputerView) : Display(computers) { val y: Int = ScreenSpace.getY(min) ?: break matrices.push() - drawMiddleAlignedText(arrowText, centerXI, y, if (minInput?.active != false) warningColor else cautionColor) + drawMiddleAlignedText(arrowText, centerXI, y, if (minInput?.active == true) warningColor else cautionColor) matrices.pop() min -= step @@ -121,9 +121,9 @@ class AttitudeDisplay(computers: ComputerView) : Display(computers) { val min: ControlInput? = computers.pitch.minimumPitch val max: ControlInput? = computers.pitch.maximumPitch val color: Int = - if (max != null && pitch >= max.target) + if (max != null && pitch > max.target) if (max.active) warningColor else cautionColor - else if (min != null && pitch <= min.target) + else if (min != null && pitch < min.target) if (min.active) warningColor else cautionColor else primaryColor