mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-23 22:54:01 -06:00
Fix the layer view when there is a print job with only one layer.
Contributes to CURA-5789.
This commit is contained in:
parent
46e0a39c15
commit
6db1342255
2 changed files with 12 additions and 2 deletions
|
@ -234,6 +234,11 @@ Item
|
|||
UM.SimulationView.setCurrentLayer(value)
|
||||
|
||||
var diff = (value - sliderRoot.maximumValue) / (sliderRoot.minimumValue - sliderRoot.maximumValue)
|
||||
// In case there is only one layer, the diff value results in a NaN, so this is for catching this specific case
|
||||
if (isNaN(diff))
|
||||
{
|
||||
diff = 0
|
||||
}
|
||||
var newUpperYPosition = Math.round(diff * (sliderRoot.height - (2 * sliderRoot.handleSize + sliderRoot.minimumRangeHandleSize)))
|
||||
y = newUpperYPosition
|
||||
|
||||
|
@ -339,6 +344,11 @@ Item
|
|||
UM.SimulationView.setMinimumLayer(value)
|
||||
|
||||
var diff = (value - sliderRoot.maximumValue) / (sliderRoot.minimumValue - sliderRoot.maximumValue)
|
||||
// In case there is only one layer, the diff value results in a NaN, so this is for catching this specific case
|
||||
if (isNaN(diff))
|
||||
{
|
||||
diff = 0
|
||||
}
|
||||
var newLowerYPosition = Math.round((sliderRoot.handleSize + sliderRoot.minimumRangeHandleSize) + diff * (sliderRoot.height - (2 * sliderRoot.handleSize + sliderRoot.minimumRangeHandleSize)))
|
||||
y = newLowerYPosition
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue