mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-17 20:57:26 +00:00
Fix incorrect layer number in G-code conflict warning (#16588)
Fix layer number in G-code conflict warning Correct the comparison used to look up a layer by Z height. The reversed comparison could return the total layer count instead of the layer corresponding to the reported conflict height.
This commit is contained in:
1 parent
8160f64cae
commit
72ba7a2b35
1 file changed
+1
-1
@@ -75,7 +75,7 @@ std::vector<float> Layers::get_zs() const
|
||||
|
||||
size_t Layers::get_layer_id_at(float z) const
|
||||
{
|
||||
auto iter = std::upper_bound(m_items.begin(), m_items.end(), z, [](float z, const Item& item) { return item.z < z; });
|
||||
auto iter = std::upper_bound(m_items.begin(), m_items.end(), z, [](float z, const Item& item) { return item.z > z; });
|
||||
return std::distance(m_items.begin(), iter);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user