mirror of
https://github.com/aaif-goose/goose.git
synced 2026-07-03 14:10:03 +02:00
08fb455eac
Fixed the issue where highlights (spell check, selection) were offset from text due to inconsistent line height calculations between layers: 1. Dynamic line height calculation: - Replaced hardcoded 21px with computed line height from actual textarea - Uses window.getComputedStyle() to get real rendered line height - Handles both 'normal' and explicit line height values properly 2. Explicit line height synchronization: - Sets both textarea and display layers to use identical pixel line heights - Added ensureLineHeightConsistency() function for ongoing sync - Called after every height sync to maintain consistency 3. Consistent cursor positioning: - Updated resetHeight method to use calculated line height - All line-based calculations now use the same computed value - Eliminates discrepancies between layers This ensures that spell check highlights, selection highlights, and cursor positioning are perfectly aligned with the actual rendered text, regardless of font size, browser differences, or CSS inheritance.