Skip Menu |

This queue is for tickets about the Tickit-RenderContext CPAN distribution.

Report information
The Basics
Id: 85243
Status: resolved
Priority: 0/
Queue: Tickit-RenderContext

People
Owner: Nobody in particular
Requestors: TEAM [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.07
Fixed in: 0.09



Subject: ->erase_at and CONT cells
Hi, Seems to be an issue around the handling of CONT cells when erasing. The attached test case dies with: TODO: cell in state 3 at ../Tickit/RenderContext.pm line 953 and this seems to happen when calling ->erase from a starting cell that currently contains CONT. My first guess would be that the cell after the erase would need updating to LINE which I'm guessing is the responsibility of the _xs_make_span code? cheers, Tom
Subject: case.pl
#!/usr/bin/perl use strict; use warnings; package TestCase; use parent qw(Tickit::Widget); use Tickit::RenderContext; use constant CLEAR_BEFORE_RENDER => 0; sub lines { 1 } sub cols { 1 } sub render { my $self = shift; my %args = @_; my $win = $self->window or return; # We're going my $rc = Tickit::RenderContext->new( lines => $win->lines, cols => $win->cols, ); $rc->hline_at(0, 2, 5, Tickit::RenderContext->LINE_SINGLE, Tickit::Pen->new(fg => 'white')); $rc->erase_at(0, 3, 6, Tickit::Pen->new(fg => 'white')); $rc->hline_at(0, 4, 7, Tickit::RenderContext->LINE_SINGLE, Tickit::Pen->new(fg => 'white')); $rc->flush_to_window($win); } package main; use Tickit::Async; $_->set_root_widget(TestCase->new) and $_->run for Tickit::Async->new;
This doesn't happen when ->erase_at length is 1, by the way - the error goes away if you replace the current: $rc->erase_at(0, 3, 6, Tickit::Pen->new(fg => 'white')); with something like $rc->erase_at(0, $_, 1, Tickit::Pen->new(fg => 'white')) for 3..9; in that test case. So, one simple (inefficient) workaround for the moment is to do all ->erase_* calls one cell at a time. Haven't seen this happen with other methods yet.
I believe this was fixed by the latest T:RC release. Running case.pl does not crash for me now. -- Paul Evans