OrcaSlicer/src
Kiss Lorand 95c6cd05fa
Fix incorrect layer and time shown in Preview legend for pause/custom G-code entries (#11968)
Fix layer/time display in Preview legend for pause/custom G-code

The Preview legend showed incorrect layer numbers and elapsed time for pause/custom G-code entries. The issue was caused by:

• get_layer_id_at() performing a strict upper_bound search on float Z values,  while custom G-code stores Z positions as doubles. Minor precision differences  often pushed the lookup to return layer 0 or the last layer.

• The legend displayed the raw zero-based layer index.

Fixes included:

• Fetch layer Z values as doubles and use an epsilon-based closest-layer search.
• Display layers as 1-based values for user-facing UI.
• Accumulate time up to the beginning of the identified layer.

This aligns the legend with the vertical slider marker and provides consistent pause/custom G-code reporting.
2026-01-16 14:20:17 -03:00
..
dev-utils Merge branch 'main' into dev/p2s-pr 2025-11-17 14:56:09 +08:00
libslic3r Fix "[warning] option: attempt to access option with wrong type: downward_check " warning 2026-01-16 00:48:50 +08:00
libvgcode QoL: improve gcode marker (#11881) 2026-01-09 11:52:30 +08:00
slic3r Fix incorrect layer and time shown in Preview legend for pause/custom G-code entries (#11968) 2026-01-16 14:20:17 -03:00
CMakeLists.txt Merge branch 'main' into libvgcode 2026-01-06 11:09:09 +08:00
OrcaSlicer.cpp FIX: CLI: fix the crash issue when load user config 2025-10-30 14:56:49 +08:00
OrcaSlicer.hpp ENH: CLI: add logic to process wrapping detect 2025-10-02 17:07:21 +08:00
OrcaSlicer_app_msvc.cpp Re-enable discrete GPU detection, as it’s no longer causing issues. 2026-01-15 19:58:13 +08:00