/// end painting
////virtual void end() {}
- /// return the width of the work area in pixels
- virtual int paperWidth() const = 0;
- /// return the height of the work area in pixels
- virtual int paperHeight() const = 0;
-
/// draw a line from point to point
virtual void line(
int x1, int y1,
+++ /dev/null
-/**
- * \file nullpainter.C
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author Alfredo Braunstein
- * \author John Levon
- *
- * Full author contact details are available in file CREDITS.
- */
-
-#include <config.h>
-
-#include "nullpainter.h"
-
-#include "LColor.h"
-
-#include <limits>
-
-
-namespace lyx {
-namespace frontend {
-
-int NullPainter::paperHeight() const
-{
- return std::numeric_limits<int>::max();
-}
-
-} // namespace frontend
-} // namespace lyx
/// end painting
void end() {}
- ///
- int paperWidth() const { return 0; }
- ///
- int paperHeight() const;
-
///
void line(int, int, int, int, LColor_color,
line_style = line_solid, line_width = line_thin) {}
*/
class QLPainter : public QPainter, public Painter {
public:
- /// return the width of the work area in pixels
- virtual int paperWidth() const;
- /// return the height of the work area in pixels
- virtual int paperHeight() const;
-
/// draw a line from point to point
virtual void line(
int x1, int y1,
void MathArray::draw(PainterInfo & pi, int x, int y) const
{
//lyxerr << "MathArray::draw: x: " << x << " y: " << y << endl;
- setXY(*pi.base.bv, x, y);
+ BufferView & bv = *pi.base.bv;
+ setXY(bv, x, y);
if (empty()) {
pi.pain.rectangle(x, y - ascent(), width(), height(), LColor::mathline);
// don't draw outside the workarea
if (y + descent() <= 0
- || y - ascent() >= pi.pain.paperHeight()
+ || y - ascent() >= bv.workHeight()
|| x + width() <= 0
- || x >= pi.pain.paperWidth())
+ || x >= bv. workWidth())
return;
- //BufferView & bv = *pi.base.bv;
for (size_t i = 0, n = size(); i != n; ++i) {
MathAtom const & at = operator[](i);
#if 0
- Buffer const & buf = *bv.buffer();
+ Buffer const & buf = bv.buffer();
// special macro handling
MathMacro const * mac = at->asMacro();
if (mac && buf.hasMacro(mac->name())) {
}
}
#endif
- //BufferView & bv = *pi.base.bv;
- pi.base.bv->coordCache().insets().add(at.nucleus(), x, y);
+ bv.coordCache().insets().add(at.nucleus(), x, y);
at->drawSelection(pi, x, y);
at->draw(pi, x, y);
x += at->width();