[Tickit-dev] Window truncation/clipping behaviour

Paul LeoNerd Evans leonerd at leonerd.org.uk
Mon Aug 6 13:34:59 BST 2012


Currently, $win->goto will complain about attempts to move the cursor
outside of the window; it requires line and col to both be >= 0 and <
max of the window. A subsequent $win->print however, will intelligently
clip the output to the righthand edge of the window, suppressing further
output beyond the righthand edge of the window.

I'd like to expand this logic, and allow ->goto to take any window
co-ordinate, and make use of the existing logic that applies clipping
when a window overlaps its parent anyway. This would suppress output
entirely when on a line out of range, and keep track of the "virtual"
cursor position when off the lefthand edge, ensuring the output is
eventually printed when the virtual cursor comes into view and becomes
physical.

This I think can simplify some render methods, that otherwise have to
implement too much of their own clipping logic.

As perhaps an extension, the goto method could return some state similar
to the Window's internal method to check visibility of a position; it
can claim any of "visible for the next $n columns", "hidden for the next
$n columns" or "hidden forever more". Perhaps this part needs some more
work...

Any thoughts?

-- 
Paul "LeoNerd" Evans

leonerd at leonerd.org.uk
ICQ# 4135350       |  Registered Linux# 179460
http://www.leonerd.org.uk/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: Digital signature
URL: <http://mail.leonerd.org.uk/pipermail/tickit-dev/attachments/20120806/aaae23c0/attachment.sig>


More information about the Tickit-dev mailing list