On Fri, Nov 21, 2003 at 08:19:07AM +0100, Alfredo Braunstein wrote:
> First a fix to checkInsetHit. (some insets on screen cannot be 
> reached by clicks).
> Fixing this remarks another problem: we draw at the row level 
> (i.e. stop drawing when the row goes out of screen), 
> but use the position information for all insets in the paragraph. 
> Thus the last rows in the last paragraph were not draw, 
> but we still check for insethits there. 

We simply should draw full paragraphs. This way we could have a smooth
drawing of 'really tall rows' and this would make the usage of
RowPainter a bit simpler, too.

InsetText::draw
LyXText::draw        (to be implemented)
Paragraph::draw      (to be implemented)
RowPainter

Nice little hierarchy. If it turns out that we waste too many cycles
that way (which I don't expect) we could always go back to 

> Patch to checkInsetHit to check only inside on-screen rows (i.e. 
> reproduce the check in rowpainter) attached.
> 
> Comments?

Too complicated for my taste i.e. premature optimization. Better try to
solve the problem robust and 'structured' rather than adding 'ifs' and
'thens' ;-)
 
> Index: text3.C
> ===================================================================
> RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text3.C,v
> retrieving revision 1.184
> diff -u -p -u -r1.184 text3.C
> --- text3.C     20 Nov 2003 10:38:12 -0000      1.184
> +++ text3.C     21 Nov 2003 07:12:23 -0000
> @@ -259,8 +259,12 @@ InsetOld * LyXText::checkInsetHit(int x,
>         ParagraphList::iterator pit;
>         ParagraphList::iterator end;
>  
> +       int const first_y = bv()->top_y() - y0_;

[Btw did I mention one of the reasons to have separate x/y cache
variables to mimic the behaviour of insets/* and mathed/*?
They are called xo_ and yo_ (from 'x _o_rigin' IIRC) there...]

Andre'

Reply via email to