-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
Description
In cortex-core/src/widgets/brain.rs, the BRAIN_WIDTH constant is set to 37, but every line in BRAIN_ART is exactly 36 characters wide.
const BRAIN_ART: &[&str] = &[
" %%#*##*****###@@ ", // 36 chars
" @%***+****+++#+**#%#@@@@ ", // 36 chars
// ... all 12 lines are 36 chars
"@#*#*++++@#****+++++*##++##%%%*#@@@@", // 36 chars (no padding)
// ...
];
const BRAIN_WIDTH: u16 = 37; // BUG: should be 36This off-by-one causes three incorrect behaviors:
- Centering is shifted:
area.width.saturating_sub(BRAIN_WIDTH) / 2subtracts 37 instead of 36, shifting the brain right by ~0.5 characters - Wave animation center is wrong:
center_x = BRAIN_WIDTH as f32 / 2.0= 18.5 instead of 18.0, making the radial pulsation asymmetric - Concentric band animation center is wrong:
get_display_charalso usesBRAIN_WIDTHfor its center, creating off-center band rings
Error Message
No crash, but visually incorrect behavior: the wave and band animations pulse from an off-center point (18.5 instead of 18.0).
Debug Logs
Verified by measuring all 12 art lines:
Line 01 Length=36: [ %%#*##*****###@@ ]
Line 02 Length=36: [ @%***+****+++#+**#%#@@@@ ]
Line 03 Length=36: [ @%*++*%#*+*+*#+++##*%%++@@@@ ]
Line 04 Length=36: [ @%***+**+++***+*#++*****%%@@%*%@@ ]
Line 05 Length=36: [ %++****+##++*++*##******%@*#@%#@@@ ]
Line 06 Length=36: [@#*#*++++@#****+++++*##++##%%%*#@@@@]
Line 07 Length=36: [%*++*+++***+*#*+++**++++**%@%#*%@@@@]
Line 08 Length=36: [@**+**+**+#*#+++#*+###*#####@@@@@@@@]
Line 09 Length=36: [ ##@@%@@#+#**###%@@%%%%#####%@@@@@@@]
Line 10 Length=36: [ @@@@ @@@@@#%@@@@@@%*+**#*#@@@@ ]
Line 11 Length=36: [ @@@@ @@%%@%%%%%%@@@ ]
Line 12 Length=36: [ @##@@@@@@ ]
System Information
Bounty Challenge System Information
====================================
Version: 0.1.0
## Operating System
OS: Windows
Version: Microsoft Windows [Version 10.0.26200.7840]
## Build Environment
Rust: rustc 1.90.0 (1159e78c4 2025-09-14)
Target: x86_64
====================================
Steps to Reproduce
- Count character widths of
BRAIN_ARTlines incortex-core/src/widgets/brain.rs - Compare with
BRAIN_WIDTHconstant (37) - All 12 lines are 36 characters —
BRAIN_WIDTHis off by one
Or, observe the animation center point: center_x = BRAIN_WIDTH as f32 / 2.0 = 18.5, but the actual center of a 36-char-wide art is 18.0.
Expected Behavior
BRAIN_WIDTH should be 36 to match the actual art width. The wave animation and centering should use the correct width.
Actual Behavior
BRAIN_WIDTH is 37, causing off-center wave animation and slightly shifted centering.
Additional Context
- Affected code:
cortex-core/src/widgets/brain.rs:50 - Fix: Change
const BRAIN_WIDTH: u16 = 37;toconst BRAIN_WIDTH: u16 = 36;
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels