rdenadai/improvements-v0.0.2 #2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "rdenadai/improvements-v0.0.2"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
1c391ab984to10f42f4424The issue was in measure_text_width_up_to_col() where column 0 (start of line) was being measured through Slint's text measurement API. Slint returns approximately 10px for an empty string (likely due to implicit cursor width or padding in the Text element). Root cause: - When col=0, the function would measure an empty string ("") - Slint's get_click_measure_width() returned ~10px instead of 0px - This offset was used as the selection start pixel position - The selection rectangle was thus offset by 10px to the right - The first character fell outside the selection rectangle Fix: - Short-circuit the measurement function to return 0.0 immediately when col=0 - Column 0 is always at the start of the line with no pixel offset - This ensures selection starts at the actual beginning of the line This fixes the pre-existing issue where Alt+D or double-clicking on the first word would not highlight the first character visually (though the selection data internally was correct).