#include "bufferparams.h"
#include "debug.h"
#include "language.h"
+#include "LColor.h"
#include "lyxfont.h"
#include "lyxrc.h"
#include "lyxrow.h"
#include "lyxtext.h"
#include "metricsinfo.h"
+#include "paragraph.h"
#include "rowpainter.h"
#include "version.h"
using lyx::support::LibFileSearch;
+using std::endl;
using std::min;
using std::max;
+using std::string;
namespace {
int newtop = top_y;
unsigned int const vheight = workarea().workHeight();
- RowList::iterator row = text->cursorRow();
+ Row & row = *text->cursorPar()->getRow(cursor.pos());
- if (int(cursor.y() - row->baseline() + row->height() - top_y) >= vheight) {
- if (row->height() < vheight
- && row->height() > vheight / 4) {
+ if (int(cursor.y() - row.baseline() + row.height() - top_y) >= vheight) {
+ if (row.height() < vheight
+ && row.height() > vheight / 4) {
newtop = cursor.y()
- + row->height()
- - row->baseline() - vheight;
+ + row.height()
+ - row.baseline() - vheight;
} else {
// scroll down, the scroll region must be so big!!
newtop = cursor.y() - vheight / 2;
}
- } else if (int(cursor.y() - row->baseline()) < top_y && top_y > 0) {
- if (row->height() < vheight && row->height() > vheight / 4) {
- newtop = cursor.y() - row->baseline();
+ } else if (int(cursor.y() - row.baseline()) < top_y && top_y > 0) {
+ if (row.height() < vheight && row.height() > vheight / 4) {
+ newtop = cursor.y() - row.baseline();
} else {
// scroll up
newtop = cursor.y() - vheight / 2;
LColor::bottomarea);
}
+ lyxerr << "Redraw screen" << endl;
+
expose(0, 0, workarea().workWidth(), workarea().workHeight());
workarea().getPainter().end();