Fix: Correct range checking for int and float Config Options + QoL changes in tooltips #1112

Closed
opened 2026-04-05 16:50:19 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @valerii-bokhan on 1/10/2026

Description

Fixes #11211 and #11069 and complements #11919

Min and max values for Config Options were integers, which caused confusion:

  • A user expects float range values for float options (e.g., print_flow_ratio), so some float options have float min and max values (see PrintConfig.cpp).
  • But float values are being cast to int (0.1 becomes 0, etc), meaning that some range checks were incorrect because of the casted values
  • It was impossible to set ranges like [0.1, 0.9] (I need to set this kind of range to fix #10235), because these ranges become [0,0], and it led to an immediate crash on Orca's start
  • Ranges were never checked for int options

This PR fixes all of these issues.

Additionally, a new utility function was added that adds ranges and default values (for int and float options only) to tooltips.

Screenshots/Recordings

A new tooltip QoL addition:
image

Before

range_check_bug

After

range_check_fix
fix #11069
fix partially #11573

*Originally created by @valerii-bokhan on 1/10/2026* # Description Fixes #11211 and #11069 and complements #11919 Min and max values for Config Options were integers, which caused confusion: - A user expects float range values for float options (e.g., `print_flow_ratio`), so some float options have float min and max values (see `PrintConfig.cpp`). - But float values are being cast to int (0.1 becomes 0, etc), meaning that some range checks were incorrect because of the casted values - It was impossible to set ranges like [0.1, 0.9] (I need to set this kind of range to fix #10235), because these ranges become [0,0], and it led to an immediate crash on Orca's start - Ranges were never checked for int options This PR fixes all of these issues. Additionally, a new utility function was added that adds ranges and default values (for int and float options only) to tooltips. # Screenshots/Recordings A new tooltip QoL addition: <img width="503" height="218" alt="image" src="https://github.com/user-attachments/assets/32f9d620-b17c-449f-9366-6490ff88e6a9" /> ### Before ![range_check_bug](https://github.com/user-attachments/assets/ca4fd9c4-f6f5-427f-a44e-d6897a872665) ### After ![range_check_fix](https://github.com/user-attachments/assets/e3cd6f50-3706-4823-b180-c3f3540fe130) fix #11069 fix partially #11573
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/OrcaSlicer#1112