/// insert an inset at cursor position
void insertInset(LCursor & cur, InsetBase * inset);
- /// compute text metrics
- void metrics(MetricsInfo & mi, Dimension & dim);
+ /// compute text metrics.
+ bool metrics(MetricsInfo & mi, Dimension & dim);
/// draw text (only used for insets)
void draw(PainterInfo & pi, int x, int y) const;
/// draw textselection
*/
Row const & getRowNearY(BufferView const & bv, int y,
pit_type pit) const;
- pit_type getPitNearY(BufferView const & bv, int y) const;
+
+ /// returns the paragraph number closest to screen y-coordinate.
+ /// This method uses the BufferView CoordCache to locate the
+ /// paragraph. The y-coodinate is allowed to be off-screen and
+ /// the CoordCache will be automatically updated if needed. This is
+ /// the reason why we need a non const BufferView and why this
+ /// method is non-const.
+ pit_type getPitNearY(BufferView & bv, int y);
/** returns the column near the specified x-coordinate of the row
x is set to the real beginning of this column
int height() const;
/// Returns an inset if inset was hit, or 0 if not.
- InsetBase * checkInsetHit(BufferView const &, int x, int y) const;
+ InsetBase * checkInsetHit(BufferView &, int x, int y);
///
int singleWidth(Buffer const &, Paragraph const & par,