If we do not do that, it is not possible to position the cursor after
a long inset with the mouse.
To do this, it is necessary to add the pit information to the Row
object. This is a good idea in any case, and will allow to simplify
some code later on.
Fixes bug #10094.
(cherry picked from commit
8851645799ef67015e49fd75b9dfeed65d685e85)
: separator(0), label_hfill(0), left_margin(0), right_margin(0),
sel_beg(-1), sel_end(-1),
begin_margin_sel(false), end_margin_sel(false),
: separator(0), label_hfill(0), left_margin(0), right_margin(0),
sel_beg(-1), sel_end(-1),
begin_margin_sel(false), end_margin_sel(false),
- changed_(false), crc_(0), pos_(0), end_(0), right_boundary_(false)
+ changed_(false), crc_(0),
+ pit_(0), pos_(0), end_(0), right_boundary_(false)
void setSelectionAndMargins(DocIterator const & beg,
DocIterator const & end) const;
void setSelectionAndMargins(DocIterator const & beg,
DocIterator const & end) const;
+ ///
+ void pit(pit_type p) { pit_ = p; }
+ ///
+ pit_type pit() const { return pit_; }
///
void pos(pos_type p) { pos_ = p; }
///
///
void pos(pos_type p) { pos_ = p; }
///
mutable bool changed_;
/// CRC of row contents.
mutable size_type crc_;
mutable bool changed_;
/// CRC of row contents.
mutable size_type crc_;
+ /// Index of the paragraph that contains this row
+ pit_type pit_;
/// first pos covered by this row
pos_type pos_;
/// one behind last pos covered by this row
/// first pos covered by this row
pos_type pos_;
/// one behind last pos covered by this row
if (row_index == pm.rows().size())
pm.rows().push_back(Row());
Row & row = pm.rows()[row_index];
if (row_index == pm.rows().size())
pm.rows().push_back(Row());
Row & row = pm.rows()[row_index];
row.pos(first);
breakRow(row, right_margin, pit);
setRowHeight(row, pit);
row.pos(first);
breakRow(row, right_margin, pit);
setRowHeight(row, pit);
int const xo = origin_.x_;
x -= xo;
int const xo = origin_.x_;
x -= xo;
+ int offset = 0;
+ CursorSlice rowSlice(const_cast<InsetText &>(text_->inset()));
+ rowSlice.pit() = row.pit();
+ rowSlice.pos() = row.pos();
+
+ // Adapt to cursor row scroll offset if applicable.
+ if (bv_->currentRowSlice() == rowSlice)
+ offset = bv_->horizScrollOffset();
+ x += offset;
+
pos_type pos = row.pos();
boundary = false;
if (row.empty())
pos_type pos = row.pos();
boundary = false;
if (row.empty())
else
boundary = row.right_boundary();
}
else
boundary = row.right_boundary();
}
//LYXERR0("getPosNearX ==> pos=" << pos << ", boundary=" << boundary);
//LYXERR0("getPosNearX ==> pos=" << pos << ", boundary=" << boundary);
public:
/// returns the position near the specified x-coordinate of the row.
/// x is an absolute screen coord, it is set to the real beginning
public:
/// returns the position near the specified x-coordinate of the row.
/// x is an absolute screen coord, it is set to the real beginning
+ /// of this column. This takes in account horizontal cursor row scrolling.
pos_type getPosNearX(Row const & row, int & x, bool & boundary) const;
/// returns pos in given par at given x coord.
pos_type getPosNearX(Row const & row, int & x, bool & boundary) const;
/// returns pos in given par at given x coord.
- Fix horizontal scrolling feature when inside a collapsable inset
with several paragraphs.
- Fix horizontal scrolling feature when inside a collapsable inset
with several paragraphs.
+- Fix selection of large formula with the mouse when horizontal
+ scrolling kicks in (but 10094).
+
- Fix display of collapsable insets when the same document is shown in
two views with different width (bug 9756).
- Fix display of collapsable insets when the same document is shown in
two views with different width (bug 9756).