migueldeicaza / TermKit

Terminal Kit - Console UI toolkit for Swift applications
MIT License
458 stars 17 forks source link

Implement clipping #8

Closed migueldeicaza closed 3 years ago

migueldeicaza commented 4 years ago

Both TermKit and gui.cs relied on "good behavior" from controls in terms of staying within their "frame" when drawing. This is generally doable, but every once in a while, a control escapes that does not take this into account and messes up the display.

More troublesome are user controls that do not want to be bothered with these details, and are a source of problems.

The design proposed for gui.cs should be replicated here: the addCh/addStr methods should not be exposed by the driver, but by the view, and the view should enforce the clipping, as well as a "logical" cursor position

migueldeicaza commented 3 years ago

I have implemented this clipping