}
// FIXME: needed when ?
- bv_->text->first_y =
- screen().topCursorVisible(bv_->text->cursor, bv_->text->first_y);
+ bv_->text->top_y(screen().topCursorVisible(bv_->text->cursor, bv_->text->top_y()));
// Similarly, buffer-dependent dialogs should be updated or
// hidden. This should go here because some dialogs (eg ToC)
bv_->theLockingInset(the_locking_inset);
}
- bv_->text->first_y = screen().topCursorVisible(bv_->text->cursor, bv_->text->first_y);
+ bv_->text->top_y(screen().topCursorVisible(bv_->text->cursor, bv_->text->top_y()));
switchKeyMap();
owner_->busy(false);
LyXText const & t = *bv_->text;
- lyxerr[Debug::GUI] << "Updating scrollbar: h " << t.height << ", first_y "
- << t.first_y << ", default height " << defaultRowHeight() << endl;
+ lyxerr[Debug::GUI] << "Updating scrollbar: h " << t.height << ", top_y() "
+ << t.top_y() << ", default height " << defaultRowHeight() << endl;
- workarea().setScrollbarParams(t.height, t.first_y, defaultRowHeight());
+ workarea().setScrollbarParams(t.height, t.top_y(), defaultRowHeight());
}
LyXText * vbt = bv_->text;
int const height = defaultRowHeight();
- int const first = static_cast<int>((bv_->text->first_y + height));
- int const last = static_cast<int>((bv_->text->first_y + workarea().workHeight() - height));
+ int const first = static_cast<int>((bv_->text->top_y() + height));
+ int const last = static_cast<int>((bv_->text->top_y() + workarea().workHeight() - height));
if (vbt->cursor.y() < first)
vbt->setCursorFromCoordinates(bv_, 0, first);
int const line_height = defaultRowHeight();
// The new absolute coordinate
- int new_first_y = t->first_y + lines * line_height;
+ int new_top_y = t->top_y() + lines * line_height;
// Restrict to a valid value
- new_first_y = std::min(t->height - 4 * line_height, new_first_y);
- new_first_y = std::max(0, new_first_y);
+ new_top_y = std::min(t->height - 4 * line_height, new_top_y);
+ new_top_y = std::max(0, new_top_y);
- scrollDocView(new_first_y);
+ scrollDocView(new_top_y);
// Update the scrollbar.
- workarea().setScrollbarParams(t->height, t->first_y, defaultRowHeight());
+ workarea().setScrollbarParams(t->height, t->top_y(), defaultRowHeight());
}
}
// FIXME: can we do this w/o calling screen directly ?
- // This updates first_y but means the fitCursor() call
+ // This updates top_y() but means the fitCursor() call
// from the update(FITCUR) doesn't realise that we might
// have moved (e.g. from GOTOPARAGRAPH), so doesn't cause
// the scrollbar to be updated as it should, so we have
// to do it manually. Any operation that does a center()
- // and also might have moved first_y must make sure to call
+ // and also might have moved top_y() must make sure to call
// updateScrollbar() currently. Never mind that this is a
- // pretty obfuscated way of updating t->first_y
+ // pretty obfuscated way of updating t->top_y()
screen().draw(t, bv_, new_y);
update(t, BufferView::SELECT | BufferView::FITCUR);
+2003-03-06 Alfredo Braunstein <abraunst@libero.it>
+
+ * lyxtext.h (top_y): added these 2 methods, and private vars top_row_
+ and top_row_offset_. removed var first_y.
+ * text.C (top_y):
+ * text2.C (LyXText, removeRow):
+ * text3.C:
+ * BufferView_pimpl.C:
+ use these methods instead of using first_y
+
2003-03-06 Lars Gullik Bjønnes <larsbj@gullik.net>
* CutAndPaste.h: make CutAndPaste a namespace.
+2003-03-06 Alfredo Braunstein <abraunst@libero.it>
+
+ * screen.C: use LyXText::top_y() instead of LyXText::first_y
+
2003-03-05 Angus Leeming <leeming@lyx.org>
* Dialogs.h: remove showWrap.
+2003-03-06 Alfredo Braunstein <abraunst@libero.it>
+
+ * qscreen.C: use LyXText::top_y() instead of LyXText::first_y
+
2003-03-06 John Levon <levon@movementarian.org>
* ui/QPrefUIModule.ui: make max last files reflect reality,
if (!qApp->focusWidget())
return;
- int const y1 = max(y - text->first_y - asc, 0);
- int const y_tmp = min(y - text->first_y + desc, owner_.height());
+ int const y1 = max(y - text->top_y() - asc, 0);
+ int const y_tmp = min(y - text->top_y() + desc, owner_.height());
// secure against very strange situations
// which would be when .... ?
if (cursor_visible_) hideCursor();
- int const old_first = text->first_y;
+ int const old_first = text->top_y();
bool const internal = (text == bv->text);
- text->first_y = y;
+ text->top_y(y);
// If you want to fix the warning below, fix it so it
// actually scrolls properly. Hint: a cast won't do.
// is any optimization possible?
if (y - old_first < owner_.workHeight()
&& old_first - y < owner_.workHeight()) {
- if (text->first_y < old_first) {
- int const dest_y = old_first - text->first_y;
+ if (text->top_y() < old_first) {
+ int const dest_y = old_first - text->top_y();
drawFromTo(text, bv, 0, dest_y, 0, 0, internal);
copyInPixmap(p, dest_y, 0, owner_.workWidth(), owner_.height() - dest_y);
expose(0, 0, owner_.workWidth(), dest_y);
} else {
- int const src_y = text->first_y - old_first;
+ int const src_y = text->top_y() - old_first;
drawFromTo(text, bv, owner_.height() - src_y, owner_.height(), 0, 0, internal);
copyInPixmap(p, 0, 0, owner_.workWidth(), owner_.height() - src_y);
expose(0, owner_.height() - src_y, owner_.workWidth(), src_y);
int /*x*/, int y, int asc, int desc)
{
int const vheight = workarea().workHeight();
- int newtop = text->first_y;
+ int newtop = text->top_y();
- if (y + desc - text->first_y >= vheight)
+ if (y + desc - text->top_y() >= vheight)
newtop = y - 3 * vheight / 4; // the scroll region must be so big!!
- else if (y - asc < text->first_y
- && text->first_y > 0) {
+ else if (y - asc < text->top_y()
+ && text->top_y() > 0) {
newtop = y - vheight / 4;
}
newtop = max(newtop, 0); // can newtop ever be < 0? (Lgb)
- if (newtop != text->first_y) {
+ if (newtop != text->top_y()) {
draw(text, bv, newtop);
- text->first_y = newtop;
+ text->top_y(newtop);
return true;
}
bool LyXScreen::fitCursor(LyXText * text, BufferView * bv)
{
// Is a change necessary?
- int const newtop = topCursorVisible(text->cursor, text->first_y);
- bool const result = (newtop != text->first_y);
+ int const newtop = topCursorVisible(text->cursor, text->top_y());
+ bool const result = (newtop != text->top_y());
if (result) {
draw(text, bv, newtop);
}
switch (text->status()) {
case LyXText::NEED_MORE_REFRESH:
{
- int const y = max(int(text->refresh_y - text->first_y), 0);
+ int const y = max(int(text->refresh_y - text->top_y()), 0);
drawFromTo(text, bv, y, vheight, yo, xo);
text->refresh_y = 0;
// otherwise this is called ONLY from BufferView_pimpl(update)
// or we should see to set this flag accordingly
if (text != bv->text)
text->status(bv, LyXText::UNCHANGED);
- expose(0, text->refresh_y - text->first_y + yo,
+ expose(0, text->refresh_y - text->top_y() + yo,
vwidth, text->refresh_row->height());
}
}
max(static_cast<int>(text->selection.end.y()
- text->selection.end.row()->baseline()
+ text->selection.end.row()->height()),
- text->first_y),
- static_cast<int>(text->first_y + workarea().workHeight()));
+ text->top_y()),
+ static_cast<int>(text->top_y() + workarea().workHeight()));
int const top = min(
max(static_cast<int>(text->selection.start.y() -
text->selection.start.row()->baseline()),
- text->first_y),
- static_cast<int>(text->first_y + workarea().workHeight()));
+ text->top_y()),
+ static_cast<int>(text->top_y() + workarea().workHeight()));
if (kill_selection)
text->selection.set(false);
workarea().getPainter().start();
- drawFromTo(text, bv, top - text->first_y, bottom - text->first_y,
+ drawFromTo(text, bv, top - text->top_y(), bottom - text->top_y(),
yo, xo);
- expose(0, top - text->first_y,
+ expose(0, top - text->top_y(),
workarea().workWidth(),
- bottom - text->first_y - (top - text->first_y));
+ bottom - text->top_y() - (top - text->top_y()));
workarea().getPainter().end();
}
+ text->toggle_end_cursor.row()->height();
int const offset = yo < 0 ? yo : 0;
- int const bottom = min(max(bottom_tmp, text->first_y),
- static_cast<int>(text->first_y + workarea().workHeight())) - offset;
- int const top = min(max(top_tmp, text->first_y),
- static_cast<int>(text->first_y + workarea().workHeight())) - offset;
+ int const bottom = min(max(bottom_tmp, text->top_y()),
+ static_cast<int>(text->top_y() + workarea().workHeight())) - offset;
+ int const top = min(max(top_tmp, text->top_y()),
+ static_cast<int>(text->top_y() + workarea().workHeight())) - offset;
workarea().getPainter().start();
- drawFromTo(text, bv, top - text->first_y,
- bottom - text->first_y, yo,
+ drawFromTo(text, bv, top - text->top_y(),
+ bottom - text->top_y(), yo,
xo);
- expose(0, top - text->first_y, workarea().workWidth(),
- bottom - text->first_y - (top - text->first_y));
+ expose(0, top - text->top_y(), workarea().workWidth(),
+ bottom - text->top_y() - (top - text->top_y()));
workarea().getPainter().end();
}
return;
}
+
+
workarea().getPainter().start();
drawFromTo(text, bv, 0, workarea().workHeight(), 0, 0, text == bv->text);
{
lyxerr[Debug::GUI] << "screen: drawFromTo " << y1 << '-' << y2 << endl;
- int y_text = text->first_y + y1;
+ int y_text = text->top_y() + y1;
// get the first needed row
Row * row = text->getRowNearY(y_text);
// y_text is now the real beginning of the row
- int y = y_text - text->first_y;
+ int y = y_text - text->top_y();
// y1 is now the real beginning of row on the screen
+
while (row != 0 && y < y2) {
LyXText::text_status st = text->status();
// we need this here as the row pointer may be illegal
// at a later time (Jug20020502)
Row * prev = row->previous();
RowPainter rp(*bv, *text, *row);
- if (rp.paint(y + yo, xo, y + text->first_y))
+
+ if (rp.paint(y + yo, xo, y + text->top_y()))
text->markChangeInDraw(bv, row, prev);
internal = internal && (st != LyXText::CHANGED_IN_DRAW);
text->status(bv, st);
Row * prev = row->previous();
RowPainter rp(*bv, *text, *row);
- if (rp.paint(y + yo, xo, y + text->first_y))
+ if (rp.paint(y + yo, xo, y + text->top_y()))
text->markChangeInDraw(bv, row, prev);
}
y += row->height();
void LyXScreen::drawOneRow(LyXText * text, BufferView * bv, Row * row,
int y_text, int yo, int xo)
{
- int const y = y_text - text->first_y + yo;
+ int const y = y_text - text->top_y() + yo;
if (((y + row->height()) > 0) &&
((y - row->height()) <= static_cast<int>(workarea().workHeight()))) {
Row * prev = row->previous();
RowPainter rp(*bv, *text, *row);
- if (rp.paint(y, xo, y + text->first_y))
+ if (rp.paint(y, xo, y + text->top_y()))
text->markChangeInDraw(bv, row, prev);
}
force_clear_ = false;
+2003-03-06 Alfredo Braunstein <abraunst@libero.it>
+
+ * xscreen.C: use LyXText::top_y() instead of LyXText::first_y
+
2003-02-28 Rob Lahaye <lahaye@snu.ac.kr>
* FormTabularCreate.C: remove slider settings (now part of .fd file)
// Update the cursor color.
setCursorColor();
- int const y1 = max(y - text->first_y - asc, 0);
- int const y_tmp = min(y - text->first_y + desc,
+ int const y1 = max(y - text->top_y() - asc, 0);
+ int const y_tmp = min(y - text->top_y() + desc,
static_cast<int>(owner_.workHeight()));
// Secure against very strange situations
if (cursor_visible_)
hideCursor();
- int const old_first = text->first_y;
+ int const old_first = text->top_y();
bool const internal = (text == bv->text);
- text->first_y = y;
+ text->top_y(y);
// is any optimization possible?
if ((y - old_first) < owner_.workHeight()
&& (old_first - y) < owner_.workHeight())
{
- if (text->first_y < old_first) {
+ if (text->top_y() < old_first) {
drawFromTo(text, bv, 0,
- old_first - text->first_y, 0, 0, internal);
+ old_first - text->top_y(), 0, 0, internal);
XCopyArea (fl_get_display(),
owner_.getWin(),
owner_.getWin(),
owner_.xpos(),
owner_.ypos(),
owner_.workWidth(),
- owner_.workHeight() - old_first + text->first_y,
+ owner_.workHeight() - old_first + text->top_y(),
owner_.xpos(),
- owner_.ypos() + old_first - text->first_y
+ owner_.ypos() + old_first - text->top_y()
);
// expose the area drawn
expose(0, 0,
owner_.workWidth(),
- old_first - text->first_y);
+ old_first - text->top_y());
} else {
drawFromTo(text, bv,
- owner_.workHeight() + old_first - text->first_y,
+ owner_.workHeight() + old_first - text->top_y(),
owner_.workHeight(), 0, 0, internal);
XCopyArea (fl_get_display(),
owner_.getWin(),
owner_.getWin(),
gc_copy,
owner_.xpos(),
- owner_.ypos() + text->first_y - old_first,
+ owner_.ypos() + text->top_y() - old_first,
owner_.workWidth(),
- owner_.workHeight() + old_first - text->first_y,
+ owner_.workHeight() + old_first - text->top_y(),
owner_.xpos(),
owner_.ypos());
// expose the area drawn
- expose(0, owner_.workHeight() + old_first - text->first_y,
- owner_.workWidth(), text->first_y - old_first);
+ expose(0, owner_.workHeight() + old_first - text->top_y(),
+ owner_.workWidth(), text->top_y() - old_first);
}
} else {
// make a dumb new-draw
+2003-03-06 Alfredo Braunstein <abraunst@libero.it>
+
+ * insettext.C:
+ * insettabular.C: use LyXText::top_y() instead of LyXText::first_y
+
2003-03-06 Lars Gullik Bjønnes <larsbj@gullik.net>
* insettext.C (updateLocal): un-const function
}
int column = actcol;
unlockInsetInInset(bv, the_locking_inset);
- if (bv->text->first_y + bv->painter().paperHeight() <
+ if (bv->text->top_y() + bv->painter().paperHeight() <
(top_baseline + tabular->GetHeightOfTabular()))
{
- bv->scrollDocView(bv->text->first_y + bv->painter().paperHeight());
+ bv->scrollDocView(bv->text->top_y() + bv->painter().paperHeight());
code = FULL;
actcell = tabular->GetCellBelow(first_visible_cell) + column;
} else {
int column = actcol;
unlockInsetInInset(bv, the_locking_inset);
if (top_baseline < 0) {
- bv->scrollDocView(bv->text->first_y - bv->painter().paperHeight());
+ bv->scrollDocView(bv->text->top_y() - bv->painter().paperHeight());
code = FULL;
if (top_baseline > 0)
actcell = column;
void InsetTabular::fitInsetCursor(BufferView * bv) const
{
if (the_locking_inset) {
- int old_first_y = bv->text->first_y;
+ int old_top_y = bv->text->top_y();
the_locking_inset->fitInsetCursor(bv);
- if (old_first_y != bv->text->first_y)
+ if (old_top_y != bv->text->top_y())
need_update = FULL;
return;
}
row = row->next();
}
if (y_offset < 0) {
- lt->first_y = -y_offset;
+ lt->top_y(-y_offset);
first = y;
y_offset = 0;
} else {
- lt->first_y = first;
+ lt->top_y(first);
first = 0;
}
if (cleared || (need_update&(INIT|FULL))) {
while ((row != 0) && (yf < ph)) {
Row * prev = row->previous();
RowPainter rp(*bv, *lt, *row);
- if (rp.paint(y + y_offset + first, int(x), y + lt->first_y, cleared))
+ if (rp.paint(y + y_offset + first, int(x), y + lt->top_y(), cleared))
lt->markChangeInDraw(bv, row, prev);
if (bv->text->status() == LyXText::CHANGED_IN_DRAW) {
lt->need_break_row = row;
lockInset(bv);
int tmp_x = cmd.x - drawTextXOffset;
- int tmp_y = cmd.y + insetAscent - getLyXText(bv)->first_y;
+ int tmp_y = cmd.y + insetAscent - getLyXText(bv)->top_y();
Inset * inset = getLyXText(bv)->checkInsetHit(bv, tmp_x, tmp_y);
hideInsetCursor(bv);
lt = getLyXText(bv);
clear = true;
}
- int old_first_y = lt->first_y;
+ int old_top_y = lt->top_y();
lt->setCursorFromCoordinates(bv, cmd.x - drawTextXOffset,
cmd.y + insetAscent);
bv->owner()->setLayout(cpar(bv)->layout()->name());
// we moved the view we cannot do mouse selection in this case!
- if (getLyXText(bv)->first_y != old_first_y)
+ if (getLyXText(bv)->top_y() != old_top_y)
no_selection = true;
old_par = cpar(bv);
// Insert primary selection with middle mouse
return the_locking_inset->localDispatch(cmd1);
int tmp_x = cmd.x - drawTextXOffset;
- int tmp_y = cmd.y + insetAscent - getLyXText(bv)->first_y;
+ int tmp_y = cmd.y + insetAscent - getLyXText(bv)->top_y();
Inset * inset = getLyXText(bv)->checkInsetHit(bv, tmp_x, tmp_y);
bool ret = false;
if (inset) {
inset_y = ciy(bv) + drawTextYOffset;
}
- t->first_y = bv->screen().topCursorVisible(t->cursor, t->first_y);
+ t->top_y(bv->screen().topCursorVisible(t->cursor, t->top_y()));
if (!owner()) {
const_cast<InsetText*>(this)->updateLocal(bv, FULL, false);
// this will scroll the screen such that the cursor becomes visible
inset_x = cix(bv) - top_x + drawTextXOffset;
inset_y = ciy(bv) + drawTextYOffset;
}
- t->first_y = bv->screen().topCursorVisible(t->cursor, t->first_y);
+ t->top_y(bv->screen().topCursorVisible(t->cursor, t->top_y()));
if (!owner()) {
const_cast<InsetText*>(this)->updateLocal(bv, FULL, false);
// this will scroll the screen such that the cursor becomes visible
mutable LyXFont current_font;
/// the current font
mutable LyXFont real_current_font;
- /// first visible pixel-row is set from LyXScreen!!!
- // unsigned is wrong here for text-insets!
- int first_y;
+private:
+ /** the first visible row on screen
+ * declared mutable because removeRow is const
+ */
+ mutable Row * top_row_;
+ /** the pixel offset with respect to this row of top_y
+ * declared mutable because removeRow is const
+ */
+ mutable int top_row_offset_;
+public:
+ /// get the y coord. of the top of the screen (relative to doc start)
+ int top_y() const;
+ /// set it
+ void top_y(int newy);
///
InsetText * inset_owner;
///
extern int bibitemMaxWidth(BufferView *, LyXFont const &);
+int LyXText::top_y() const
+{
+ if (!top_row_)
+ return 0;
+
+ int y = 0;
+ for (Row * row = firstrow; row && row != top_row_; row = row->next()) {
+ y += row->height();
+ }
+ return y + top_row_offset_;
+}
+
+
+void LyXText::top_y(int newy)
+{
+ if (!firstrow)
+ return;
+ lyxerr[Debug::GUI] << "setting top y = " << newy << endl;
+
+ int y = newy;
+ top_row_ = getRowNearY(y);
+ top_row_offset_ = newy - y;
+ lyxerr[Debug::GUI] << "changing reference to row: " << top_row_
+ << " offset: " << top_row_offset_ << endl;
+}
+
+
int LyXText::workWidth(BufferView & bview) const
{
if (inset_owner) {
LyXText::LyXText(BufferView * bv)
- : height(0), width(0), first_y(0),
+ : height(0), width(0), top_row_(0), top_row_offset_(0),
inset_owner(0), the_locking_inset(0), need_break_row(0),
refresh_y(0), refresh_row(0), bv_owner(bv),
status_(LyXText::UNCHANGED), firstrow(0), lastrow(0)
LyXText::LyXText(InsetText * inset)
- : height(0), width(0), first_y(0),
+ : height(0), width(0), top_row_(0), top_row_offset_(0),
inset_owner(inset), the_locking_inset(0), need_break_row(0),
refresh_y(0), refresh_row(0), bv_owner(0),
status_(LyXText::UNCHANGED), firstrow(0), lastrow(0)
need_break_row = 0;
width = height = 0;
copylayouttype.erase();
- first_y = refresh_y = 0;
+ top_y(refresh_y = 0);
status_ = LyXText::UNCHANGED;
} else if (firstrow)
return;
refresh_row = row_prev ? row_prev : row->next();
// what about refresh_y, refresh_height
}
+ if (top_row_ == row) {
+ if (row->next()) {
+ top_row_ = row->next();
+ top_row_offset_ -= row->height();
+ } else {
+ top_row_ = row_prev;
+ top_row_offset_ = 0;
+ }
+ }
height -= row->height(); // the text becomes smaller
int y = cursor.y() - cursor.row()->baseline() - 1;
setCursorFromCoordinates(bview, x, y);
if (!selecting) {
- int y1 = cursor.iy() - first_y;
+ int topy = top_y();
+ int y1 = cursor.iy() - topy;
int y2 = y1;
- y -= first_y;
+ y -= topy;
Inset * inset_hit = checkInsetHit(bview, x, y1);
if (inset_hit && isHighlyEditableInset(inset_hit)) {
inset_hit->edit(bview, x, y - (y2 - y1), mouse_button::none);
cursor.row()->height() + 1;
setCursorFromCoordinates(bview, x, y);
if (!selecting && cursor.row() == cursor.irow()) {
- int y1 = cursor.iy() - first_y;
+ int topy = top_y();
+ int y1 = cursor.iy() - topy;
int y2 = y1;
- y -= first_y;
+ y -= topy;
Inset * inset_hit = checkInsetHit(bview, x, y1);
if (inset_hit && isHighlyEditableInset(inset_hit)) {
inset_hit->edit(bview, x, y - (y2 - y1), mouse_button::none);
Inset * LyXText::checkInsetHit(BufferView * bv, int & x, int & y) const
{
- int y_tmp = y + first_y;
+ int y_tmp = y + top_y();
LyXCursor cur;
setCursorFromCoordinates(bv, cur, x, y_tmp);
void LyXText::cursorPrevious(BufferView * bv)
{
if (!cursor.row()->previous()) {
- if (first_y > 0) {
- int new_y = bv->text->first_y - bv->workHeight();
+ if (top_y() > 0) {
+ int new_y = top_y() - bv->workHeight();
bv->screen().draw(bv->text, bv, new_y < 0 ? 0 : new_y);
bv->updateScrollbar();
}
return;
}
- int y = first_y;
+ int y = top_y();
Row * cursorrow = cursor.row();
setCursorFromCoordinates(bv, cursor.x_fix(), y);
// This is what we used to do, so we wouldn't skip right past
// tall rows, but it's not working right now.
#if 0
- new_y = bv->text->first_y - bv->workHeight();
+ new_y = bv->text->top_y() - bv->workHeight();
#endif
} else {
if (inset_owner) {
LyXCursor cur;
setCursor(bv, cur, cursor.row()->previous()->par(),
cursor.row()->previous()->pos(), false);
- if (cur.y() > first_y) {
+ if (cur.y() > top_y()) {
cursorUp(bv, true);
}
}
if (!cursor.row()->next()) {
int y = cursor.y() - cursor.row()->baseline() +
cursor.row()->height();
- if (y > int(first_y + bv->workHeight())) {
- bv->screen().draw(bv->text, bv,
- bv->text->first_y + bv->workHeight());
+ if (y > top_y() + bv->workHeight()) {
+ bv->screen().draw(bv->text, bv, top_y() + bv->workHeight());
bv->updateScrollbar();
}
return;
}
- int y = first_y + bv->workHeight();
- if (inset_owner && !first_y) {
+ int y = top_y() + bv->workHeight();
+ if (inset_owner && !top_y()) {
y -= (bv->text->cursor.iy()
- - bv->text->first_y
+ - bv->text->top_y()
+ bv->theLockingInset()->insetInInsetY());
}
// This is what we used to do, so we wouldn't skip right past
// tall rows, but it's not working right now.
#if 0
- new_y = bv->text->first_y + bv->workHeight();
+ new_y = bv->text->top_y() + bv->workHeight();
#endif
} else {
if (inset_owner) {
LyXCursor cur;
setCursor(bv, cur, cursor.row()->next()->par(),
cursor.row()->next()->pos(), false);
- if (cur.y() < int(first_y + bv->workHeight())) {
+ if (cur.y() < top_y() + bv->workHeight()) {
cursorDown(bv, true);
}
}
int start_x = inset_x + tli->scroll();
FuncRequest cmd1 = cmd;
cmd1.x = cmd.x - start_x;
- cmd1.y = cmd.y - cursor.iy() + bv->text->first_y;
+ cmd1.y = cmd.y - cursor.iy() + bv->text->top_y();
tli->localDispatch(cmd1);
break;
}
bv->screen().hideCursor();
Row * cursorrow = bv->text->cursor.row();
- bv->text->setCursorFromCoordinates(bv, cmd.x, cmd.y + bv->text->first_y);
+ bv->text->setCursorFromCoordinates(bv, cmd.x, cmd.y + bv->text->top_y());
#if 0
// sorry for this but I have a strange error that the y value jumps at
// a certain point. This seems like an error in my xforms library or
#endif
// This is to allow jumping over large insets
if (cursorrow == bv->text->cursor.row()) {
- if (cmd.y >= int(bv->workHeight()))
+ if (cmd.y >= bv->workHeight())
bv->text->cursorDown(bv, false);
else if (cmd.y < 0)
bv->text->cursorUp(bv, false);
paste_internally = true;
}
- int const screen_first = bv->text->first_y;
+ int const screen_first = bv->text->top_y();
if (bv->theLockingInset()) {
// We are in inset locking mode