os-crystal icon indicating copy to clipboard operation
os-crystal copied to clipboard

OutputConsole#put_byte should check for going past border of @framebuffer

Open drhuffman12 opened this issue 8 years ago • 4 comments

This method checks for @col >= 80 in one place, but checks @col == 80 in another. Maybe they should both check '>='.

Also, there are no checks for @row going past the border [or wrapping around].

drhuffman12 avatar Dec 20 '16 03:12 drhuffman12

You should put anything using the at symbol inside backticks (`@foo`), since you ended up pinging two users named row and col.

refi64 avatar Dec 20 '16 04:12 refi64

😎

Row avatar Dec 20 '16 06:12 Row

oops, sorry

drhuffman12 avatar Dec 20 '16 08:12 drhuffman12

It mostly prints one character at a time, so checking just for @col == 80 is fine there. The only situation where this isn't true if when printing a tab \t. Here the cursor can go beyond 80 and the check needs to be >=. Having both be >= is no harm, but there is no need.

@row needs to be checked, and cause a scroll.

lbguilherme avatar Dec 20 '16 09:12 lbguilherme