#include <config.h>
#include "screen.h"
+#include "font_metrics.h"
+#include "lyx_gui.h"
+#include "Painter.h"
+#include "WorkArea.h"
-#include "lyxtext.h"
-#include "lyxrc.h"
-#include "lyxrow.h"
#include "BufferView.h"
#include "buffer.h"
-#include "WorkArea.h"
-#include "Painter.h"
-#include "font_metrics.h"
-#include "language.h"
+#include "bufferparams.h"
#include "debug.h"
-#include "rowpainter.h"
-#include "insets/updatableinset.h"
-#include "lyx_gui.h"
-#include "metricsinfo.h"
-
-// Splash screen-specific stuff
+#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"
-#include "graphics/GraphicsLoader.h"
+#include "insets/updatableinset.h"
+
#include "graphics/GraphicsImage.h"
+#include "graphics/GraphicsLoader.h"
#include "support/filetools.h" // LibFileSearch
#include <boost/bind.hpp>
#include <boost/signals/trackable.hpp>
-using namespace lyx::support;
+using lyx::support::LibFileSearch;
+using std::endl;
using std::min;
using std::max;
-using std::endl;
+using std::string;
+
namespace {
LyXText const & text = *bv.getLyXText();
LyXFont const & realfont = text.real_current_font;
- BufferParams const & bp = bv.buffer()->params;
+ BufferParams const & bp = bv.buffer()->params();
bool const samelang = realfont.language() == bp.language;
bool const isrtl = realfont.isVisibleRightToLeft();
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();