- Row const & getRowNearY(int y, pit_type pit) const;
- pit_type getPitNearY(int y) const;
-
- /** returns the column near the specified x-coordinate of the row
- x is set to the real beginning of this column
- */
- pos_type getColumnNearX(pit_type pit,
- Row const & row, int & x, bool & boundary) const;
+ /// FIXME: move to TextMetrics.
+ Row const & getRowNearY(BufferView const & bv, int y,
+ pit_type pit) 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.
+ /// FIXME: move to TextMetrics.
+ pit_type getPitNearY(BufferView & bv, int y);