mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-09-20 06:49:56 +00:00
2001-12-28 Lars Gullik Bj�nnes <larsbj@birdstep.com>
screen.C (topCursorVisible): introduce a temp var for handle the case where this row is null. (kindo git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3272 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
b56204339c
commit
5d8704acff
@ -1,5 +1,9 @@
|
||||
2001-12-28 Lars Gullik Bjønnes <larsbj@birdstep.com>
|
||||
|
||||
* screen.C (topCursorVisible): introduce a temp var for
|
||||
text->cursor.row(), handle the case where this row is null. (kindo
|
||||
hachish)
|
||||
|
||||
* text2.C (setCursor): add a couple of asserts.
|
||||
|
||||
* paragraph.h (inset_iterator): add -> operator
|
||||
|
29
src/screen.C
29
src/screen.C
@ -388,27 +388,30 @@ unsigned int LyXScreen::topCursorVisible(LyXText const * text)
|
||||
{
|
||||
int newtop = text->first;
|
||||
|
||||
if (text->cursor.y()
|
||||
- text->cursor.row()->baseline()
|
||||
+ text->cursor.row()->height()
|
||||
Row * row = text->cursor.row();
|
||||
|
||||
// Is this a hack? Yes, probably... (Lgb)
|
||||
if (!row)
|
||||
return max(newtop, 0);
|
||||
|
||||
if (text->cursor.y() - row->baseline() + row->height()
|
||||
- text->first >= owner.height()) {
|
||||
if (text->cursor.row()->height() < owner.height()
|
||||
&& text->cursor.row()->height() > owner.height() / 4) {
|
||||
if (row->height() < owner.height()
|
||||
&& row->height() > owner.height() / 4) {
|
||||
newtop = text->cursor.y()
|
||||
+ text->cursor.row()->height()
|
||||
- text->cursor.row()->baseline() - owner.height();
|
||||
+ row->height()
|
||||
- row->baseline() - owner.height();
|
||||
} else {
|
||||
// scroll down
|
||||
newtop = text->cursor.y()
|
||||
- owner.height() / 2; /* the scroll region must be so big!! */
|
||||
}
|
||||
|
||||
} else if (static_cast<int>((text->cursor.y()) - text->cursor.row()->baseline()) <
|
||||
text->first && text->first > 0)
|
||||
{
|
||||
if (text->cursor.row()->height() < owner.height()
|
||||
&& text->cursor.row()->height() > owner.height() / 4) {
|
||||
newtop = text->cursor.y() - text->cursor.row()->baseline();
|
||||
} else if (static_cast<int>((text->cursor.y()) - row->baseline()) <
|
||||
text->first && text->first > 0) {
|
||||
if (row->height() < owner.height()
|
||||
&& row->height() > owner.height() / 4) {
|
||||
newtop = text->cursor.y() - row->baseline();
|
||||
} else {
|
||||
// scroll up
|
||||
newtop = text->cursor.y() - owner.height() / 2;
|
||||
|
Loading…
Reference in New Issue
Block a user