lyxerr[Debug::GUI] << "text_height now " << text_height << endl;
lyxerr[Debug::GUI] << "work_height " << work_height << endl;
-
+
/* If the text is smaller than the working area, the scrollbar
* maximum must be the working area height. No scrolling will
* be possible */
void BufferView::Pimpl::scrollCB(double value)
{
lyxerr[Debug::GUI] << "scrollCB of " << value << endl;
-
+
if (!buffer_) return;
current_scrollbar_value = long(value);
cursor.par(), cursor.pos());
int width = bv_->theLockingInset()->width(bv_, font);
int inset_x = font.isVisibleRightToLeft()
- ? cursor.x() - width : cursor.x();
+ ? cursor.ix() - width : cursor.ix();
int start_x = inset_x + bv_->theLockingInset()->scroll();
bv_->theLockingInset()->
insetMotionNotify(bv_,
x - start_x,
- y - cursor.y() + bv_->text->first_y,
+ y - cursor.iy() + bv_->text->first_y,
state);
return;
}
int const width = inset.width(bv_, font);
int const inset_x = font.isVisibleRightToLeft()
- ? (cursor.x() - width) : cursor.x();
+ ? (cursor.ix() - width) : cursor.ix();
return Box(
inset_x + inset.scroll(),
inset_x + width,
- cursor.y() - inset.ascent(bv_, font),
- cursor.y() + inset.descent(bv_, font));
+ cursor.iy() - inset.ascent(bv_, font),
+ cursor.iy() + inset.descent(bv_, font));
}
x -= b.x1;
// The origin of an inset is on the baseline
- y -= (text.cursor.y());
+ y -= text.cursor.iy();
return inset;
}
int y = text->first_y;
Row * cursorrow = text->cursor.row();
- text->setCursorFromCoordinates(bv_, bv_->text->cursor.x_fix(), y);
+ text->setCursorFromCoordinates(bv_, text->cursor.x_fix(), y);
finishUndo();
// This is to allow jumping over large insets
if ((cursorrow == text->cursor.row()))
text->cursorUp(bv_);
- if (text->inset_owner ||
- text->cursor.row()->height() < workarea_.height())
- screen_->draw(bv_->text, bv_,
+ if (text->inset_owner) {
+ int new_y = bv_->text->cursor.iy()
+ + bv_->theLockingInset()->insetInInsetY()
+ + y
+ + text->cursor.row()->height()
+ - workarea_.height() + 1;
+
+ screen_->draw(bv_->text, bv_, new_y < 0 ? 0 : new_y);
+ } else if (text->cursor.row()->height() < workarea_.height()) {
+ screen_->draw(text, bv_,
text->cursor.y()
- text->cursor.row()->baseline()
+ text->cursor.row()->height()
- workarea_.height() + 1);
+ }
updateScrollbar();
}
return;
int y = text->first_y + workarea_.height();
-// if (text->inset_owner)
-// y += bv_->text->first;
+ if (text->inset_owner && !text->first_y) {
+ y -= (bv_->text->cursor.iy()
+ - bv_->text->first_y
+ + bv_->theLockingInset()->insetInInsetY());
+ }
text->getRowNearY(y);
Row * cursorrow = text->cursor.row();
if ((cursorrow == bv_->text->cursor.row()))
text->cursorDown(bv_);
- if (text->inset_owner ||
- text->cursor.row()->height() < workarea_.height())
- screen_->draw(bv_->text, bv_, text->cursor.y() -
+ if (text->inset_owner) {
+ screen_->draw(bv_->text, bv_,
+ bv_->text->cursor.iy()
+ + bv_->theLockingInset()->insetInInsetY()
+ + y - text->cursor.row()->baseline());
+ } else if (text->cursor.irow()->height() < workarea_.height()) {
+ screen_->draw(text, bv_, text->cursor.y() -
text->cursor.row()->baseline());
+ } else {
+ }
updateScrollbar();
}
inline
-void BufferView::Pimpl::moveCursorUpdate(bool selecting)
+void BufferView::Pimpl::moveCursorUpdate(bool selecting, bool fitcur)
{
LyXText * lt = bv_->getLyXText();
updateInset(lt->inset_owner, false);
}
if (lt->bv_owner) {
- update(lt, BufferView::SELECT|BufferView::FITCUR);
+ if (fitcur)
+ update(lt, BufferView::SELECT|BufferView::FITCUR);
+ else
+ update(lt, BufferView::SELECT);
showCursor();
}
update(lt, BufferView::UPDATE);
cursorNext(lt);
finishUndo();
- moveCursorUpdate(false);
+ moveCursorUpdate(false, false);
owner_->showState();
}
break;
update(lt,
BufferView::SELECT|BufferView::FITCUR);
- lt->cursorUp(bv_);
+ lt->cursorUp(bv_, true);
finishUndo();
moveCursorUpdate(true);
owner_->showState();
update(lt,
BufferView::SELECT|BufferView::FITCUR);
- lt->cursorDown(bv_);
+ lt->cursorDown(bv_, true);
finishUndo();
moveCursorUpdate(true);
owner_->showState();