@@ -692,6 +692,7 @@ def add_dialog_proc(name, p, context = nil)
692
692
bar_height = ( bar_max_height * ( ( dialog . contents . size * 2 ) . to_f / ( dialog_render_info . contents . size * 2 ) ) ) . floor . to_i
693
693
position = ( ( bar_max_height - bar_height ) * position_ratio ) . floor . to_i
694
694
end
695
+ block_elem_size = calculate_width ( '█' )
695
696
dialog . contents . each_with_index do |item , i |
696
697
if i == pointer
697
698
bg_color = '45'
@@ -706,23 +707,23 @@ def add_dialog_proc(name, p, context = nil)
706
707
@output . write "\e [#{ bg_color } m#{ str } "
707
708
if dialog_render_info . scrollbar and dialog_render_info . contents . size > height
708
709
@output . write "\e [37m"
709
- if position <= ( i * 2 ) and ( i * 2 + 1 ) < ( position + bar_height )
710
+ if position <= ( i * 2 ) and ( i * 2 + block_elem_size ) < ( position + bar_height )
710
711
@output . write '█'
711
712
elsif position <= ( i * 2 ) and ( i * 2 ) < ( position + bar_height )
712
713
@output . write '▀'
713
714
str += ''
714
- elsif position <= ( i * 2 + 1 ) and ( i * 2 ) < ( position + bar_height )
715
+ elsif position <= ( i * 2 + block_elem_size ) and ( i * 2 ) < ( position + bar_height )
715
716
@output . write '▄'
716
717
else
717
- @output . write ' '
718
+ @output . write ' ' * block_elem_size
718
719
end
719
720
@output . write "\e [39m"
720
721
end
721
722
@output . write "\e [49m"
722
723
Reline ::IOGate . move_cursor_column ( dialog . column )
723
724
move_cursor_down ( 1 ) if i < ( dialog . contents . size - 1 )
724
725
end
725
- dialog . width += 1 if dialog_render_info . scrollbar and dialog_render_info . contents . size > height
726
+ dialog . width += block_elem_size if dialog_render_info . scrollbar and dialog_render_info . contents . size > height
726
727
Reline ::IOGate . move_cursor_column ( cursor_column )
727
728
move_cursor_up ( dialog . vertical_offset + dialog . contents . size - 1 )
728
729
Reline ::IOGate . show_cursor
0 commit comments