From c2072fa890cb98db71317430572d7992edf6ef5c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Wed, 13 Mar 2002 11:17:21 +0000 Subject: [PATCH] don't draw invisible things... git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3737 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/math_cursor.C | 5 +++-- src/mathed/math_xdata.C | 11 +++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/mathed/math_cursor.C b/src/mathed/math_cursor.C index c2a82d1222..c3ee8d0996 100644 --- a/src/mathed/math_cursor.C +++ b/src/mathed/math_cursor.C @@ -1224,8 +1224,9 @@ bool MathCursor::bruteFind(int x, int y, int xlow, int xhigh, int ylow, int yhig while (1) { // avoid invalid nesting when selecting if (!selection_ || positionable(it.cursor(), Anchor_)) { - int xo = it.position().xpos(); - int yo = it.position().ypos(); + MathCursorPos const & top = it.position(); + int xo = top.xpos(); + int yo = top.ypos(); if (xlow - 2 <= xo && xo <= xhigh + 2 && ylow - 2 <= yo && yo <= yhigh + 2) { diff --git a/src/mathed/math_xdata.C b/src/mathed/math_xdata.C index 914844d9e6..1bc7bb0242 100644 --- a/src/mathed/math_xdata.C +++ b/src/mathed/math_xdata.C @@ -74,10 +74,21 @@ void MathXArray::draw(Painter & pain, int x, int y) const //if (drawn_ && x == xo_ && y == yo_) // return; + //lyxerr << "x: " << x << " y: " << y << " " << pain.workAreaHeight() << endl; + xo_ = x; yo_ = y; drawn_ = true; + if (y + descent_ <= 0) // don't draw above the workarea + return; + if (y - ascent_ >= pain.paperHeight()) // don't draw below the workarea + return; + if (x + width_ <= 0) // don't draw left of workarea + return; + if (x >= pain.paperWidth()) // don't draw right of workarea + return; + const_iterator it = begin(), et = end(); if (it == et) { -- 2.39.2