Fix text positioning by calculating visual width without ANSI codes
The motion effects were appearing with incorrect row offsets because the text width calculation included ANSI color escape sequences in the byte length, causing misaligned centering. Changes: - Added utils/ansi.rs module with strip_ansi() and visual_width() - Updated renderer to use visual_width() for offset positioning - Updated TerminalManager::print_centered() to use visual_width() - All text positioning now correctly ignores ANSI escape sequences This fixes the "shifted in the rows" issue where colored text was not properly centered due to escape sequence byte counts. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,2 +1,3 @@
|
||||
pub mod ansi;
|
||||
pub mod ascii;
|
||||
pub mod terminal;
|
||||
|
||||
Reference in New Issue
Block a user