mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Use reversed get_screen_size correctly on Windows
This commit is contained in:
parent
5ceff480c2
commit
fafcbe0eb0
1 changed files with 2 additions and 2 deletions
|
@ -150,12 +150,12 @@ class Reline::Windows
|
||||||
@@GetConsoleScreenBufferInfo.call(@@hConsoleHandle, csbi)
|
@@GetConsoleScreenBufferInfo.call(@@hConsoleHandle, csbi)
|
||||||
cursor = csbi[4, 4].unpack('L').first
|
cursor = csbi[4, 4].unpack('L').first
|
||||||
written = 0.chr * 4
|
written = 0.chr * 4
|
||||||
@@FillConsoleOutputCharacter.call(@@hConsoleHandle, 0x20, get_screen_size.first - cursor_pos.x, cursor, written)
|
@@FillConsoleOutputCharacter.call(@@hConsoleHandle, 0x20, get_screen_size.last - cursor_pos.x, cursor, written)
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.scroll_down(val)
|
def self.scroll_down(val)
|
||||||
return if val.zero?
|
return if val.zero?
|
||||||
scroll_rectangle = [0, val, get_screen_size.last, get_screen_size.first].pack('s4')
|
scroll_rectangle = [0, val, get_screen_size.first, get_screen_size.last].pack('s4')
|
||||||
destination_origin = 0 # y * 65536 + x
|
destination_origin = 0 # y * 65536 + x
|
||||||
fill = [' '.ord, 0].pack('SS')
|
fill = [' '.ord, 0].pack('SS')
|
||||||
@@ScrollConsoleScreenBuffer.call(@@hConsoleHandle, scroll_rectangle, nil, destination_origin, fill)
|
@@ScrollConsoleScreenBuffer.call(@@hConsoleHandle, scroll_rectangle, nil, destination_origin, fill)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue