Closed qindapao closed 1 year ago
@nkh I have fixed it, and Also fixed a command box encoding error in some environments.
https://github.com/qindapao/P5-App-Asciio/tree/fix_binding_compl
This time I tried to draw a asciio to analyze this problem
y
^
│
│
(mouse_x = 0,mouse_y = 0) │
| │
| │
'---------->o═══════════════════════════╤═══════════════╗ ──────
│ ┃ ^ ║ ^
│ ┃ │ ║ │
│ ┃ │ ║ │
│ │ │ ║ │
│ │ window_height ║ │
│ │ │ ║ │ CANVAS_HEIGHT * character_height
.---------------. │ │ │ ║ │
| initial state | │ │ │ ║ │
'---------------' │ │ v ║ │
─────┾━━━━━━─────────────────────┼───────────────╫────┼──────> x
│ │ ║ │
│<─────────────────────────>│ ║ │
│ window_width │ ║ │
│ ║ │
│ ║ │
│ ║ v
╞═══════════════════════════════════════════╝ ──────
│
│ │
│<─────────────────────────────────────────>│
│ CANVAS_WIDTH * character_width │
(mouse_x = 0,mouse_y = 0)
|
'-------. y my ($window_width, $window_height) = $self->{root_window}->get_size() ;
| ^ my ($scroll_bar_x, $scroll_bar_y) = ($self->{sc_window}->get_hadjustment(), $self->{sc_window}->get_vadjustment()) ;
-------------------. | │
scroll bar scroll | v │
-------------------' ╔═══════╪═══════════════════════════════════╗---------------------------------------
║ │ ║ ^
║ │ ║ │scroll_bar_y
║ ├───────────────────────────╮---------------------------------------v
║ │ │ ║
║ │ *(mouse_x,mouse_y) │ ║
scroll_bar_x │ ┃ ║
║<─────>│ ┃ ║
║ │ ┃ ║
║ │ ┃ ║
║ │ │ ║
║ │ │ ║
║ │ │ ║
║ ─────┼─────━━━━━━━───────────────┴───────╫───────────────────> x
║ │ ║
║ │ ║
║ │ ║
╚═══════╪═══════════════════════════════════╝
│
│
│
│
│
@qindapao merged
If the scroll bar is not in the initial position, the key completion popup will be in the wrong position.