don't draw invisible things...

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3737 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2002-03-13 11:17:21 +00:00
parent 97ffd5e934
commit c2072fa890
2 changed files with 14 additions and 2 deletions

View File

@ -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)
{

View File

@ -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) {