This was a regression. The previous logic would always show the cursor
if we were using a non-blinking cursor. But, if the terminal state is
explicitly requesting an invisible cursor (mode 25) then we need to hide
the cursor.
Font metrics realistically should be integral. Cell widths, cell
heights, etc. do not make sense to be floats, since our grid is
integral. There is no such thing as a "half cell" (or any point).
The reason we historically had these all as f32 is simplicity mixed
with history. OpenGL APIs and shaders all use f32 for their values, we
originally only supported OpenGL, and all the font rendering used to be
directly in the renderer code (like... a year+ ago).
When we refactored the font metrics calculation to its own system and
also added additional renderers like Metal (which use f64, not f32), we
never updated anything. We just kept metrics as f32 and casted
everywhere.
With CoreText and #177 this finally reared its ugly head. By forgetting
a simple rounding on cell metric calculation, our integral renderers
(sprite fonts) were off by 1 pixel compared to the GPU renderers.
Insidious.
Let's represent font metrics with the types that actually make sense: a
cell width/height, etc. is _integral_. When we get to the GPU, we now
cast to floats. We also cast to floats whenever we're doing more precise
math (i.e. mouse offset calculation). In this case, we're only
converting to floats from a integral type which is going to be much
safer and less prone to uncertain rounding than converting to an int
from a float type.
Fixes#177
We previously used the "screen.viewportIsBottom" check but this is
always true since awhile back since we copy only the viewport now. A
cleaner check really is that we only track the cursor cell if we're even
drawing the cursor.
The Metal system automatically will free hardware resources when no
other references exist (I believe) and this causes a crash if you close
a window while a render is in-flight.
We were previously using the bounds which might be updated later if the
view is in the middle of an animation. Just use the size that represents
our target state.