On Tue, Aug 28, 2007 at 04:39:47PM +0000, [EMAIL PROTECTED] wrote:
> Author: younes
> Date: Tue Aug 28 18:39:46 2007
> New Revision: 19859
> 
> URL: http://www.lyx.org/trac/changeset/19859
> Log:
> We are not forced to redraw the row each time the cursor is moved.
> 
> * TextMetrics.cpp: CursorOnRow() removed.
> * TextMetrics::drawParagraph() do not check cursor position.
> 
> Modified:
>     lyx-devel/trunk/src/TextMetrics.cpp
> 
> Modified: lyx-devel/trunk/src/TextMetrics.cpp
> URL: 
> http://www.lyx.org/trac/file/lyx-devel/trunk/src/TextMetrics.cpp?rev=19859
> ==============================================================================
> --- lyx-devel/trunk/src/TextMetrics.cpp (original)
> +++ lyx-devel/trunk/src/TextMetrics.cpp Tue Aug 28 18:39:46 2007
> @@ -976,26 +976,6 @@
>       }
>  }
>  
> -namespace {
> -
> -bool CursorOnRow(PainterInfo & pi, pit_type const pit,
> -     RowList::const_iterator rit, Text const & text)
> -{
> -     // Is there a cursor on this row (or inside inset on row)
> -     Cursor & cur = pi.base.bv->cursor();
> -     for (size_type d = 0; d < cur.depth(); ++d) {
> -             CursorSlice const & sl = cur[d];
> -             if (sl.text() == &text
> -                 && sl.pit() == pit
> -                 && sl.pos() >= rit->pos()
> -                 && sl.pos() <= rit->endpos())
> -                     return true;
> -     }
> -     return false;
> -}
> -
> -} // namespace anon
> -
>  
>  void TextMetrics::drawParagraph(PainterInfo & pi, pit_type pit, int x, int y,
>        bool repaintAll) const
> @@ -1021,12 +1001,10 @@
>               // Row signature; has row changed since last paint?
>               bool row_has_changed = pm.rowChangeStatus()[rowno];
>  
> -             bool cursor_on_row = CursorOnRow(pi, pit, rit, *text_);
> -
>               // If selection is on, the current row signature differs
>               // from cache, or cursor is inside an inset _on this row_,
>               // then paint the row
> -             if (repaintAll || row_has_changed || cursor_on_row) {
> +             if (repaintAll || row_has_changed) {

After a long journey through the desert, got it rebuilt and confirmed
what the reason was that 'cursor_on_row' was needed in the first place.
Just turn change tracking on and try to delete characters from a row.
Neither the row signature nor its metric changes... just some black 
characters turning blue. And after this patch, _this does not show_, as
the row isn't refreshed anymore.

If you don't want cursor_on_row back, consider making the row signature
sensitive to change tracking.

- Martin

>                       bool const inside = (y + rit->descent() >= 0
>                               && y - rit->ascent() < ww);
>                       // it is not needed to draw on screen if we are not 
> inside.
> @@ -1046,8 +1024,7 @@
>                                       LYXERR(Debug::PAINTING) << "#";
>                               else
>                                       LYXERR(Debug::PAINTING) << "[" <<
> -                                             repaintAll << row_has_changed <<
> -                                             cursor_on_row << "]";
> +                                             repaintAll << row_has_changed 
> << "]";
>                       }
>                       rp.paintAppendix();
>                       rp.paintDepthBar();
> 
> 
> _______________________________________________
> Cvslog mailing list
> [EMAIL PROTECTED]
> http://www.lyx.org/mailman/listinfo/cvslog
> 

Reply via email to