use setPosCache where appropriate

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8916 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2004-08-13 22:39:39 +00:00
parent b119fd180d
commit 596a2ca159
3 changed files with 6 additions and 12 deletions

View File

@ -276,9 +276,8 @@ void MathArray::metrics(MetricsInfo & mi) const
void MathArray::draw(PainterInfo & pi, int x, int y) const void MathArray::draw(PainterInfo & pi, int x, int y) const
{ {
//lyxerr << "MathArray::draw: x: " << x << " y: " << y << endl; //lyxerr << "MathArray::draw: x: " << x << " y: " << y << endl;
xo_ = x;
xo_ = x; yo_ = y;
yo_ = y;
if (empty()) { if (empty()) {
pi.pain.rectangle(x, y - ascent(), width(), height(), LColor::mathline); pi.pain.rectangle(x, y - ascent(), width(), height(), LColor::mathline);
@ -332,16 +331,13 @@ void MathArray::metricsT(TextMetricsInfo const & mi, Dimension & dim) const
void MathArray::drawT(TextPainter & pain, int x, int y) const void MathArray::drawT(TextPainter & pain, int x, int y) const
{ {
//if (drawn_ && x == xo_ && y == yo_)
// return;
//lyxerr << "x: " << x << " y: " << y << ' ' << pain.workAreaHeight() << endl; //lyxerr << "x: " << x << " y: " << y << ' ' << pain.workAreaHeight() << endl;
xo_ = x; xo_ = x;
yo_ = y; yo_ = y;
drawn_ = true;
for (const_iterator it = begin(), et = end(); it != et; ++it) { for (const_iterator it = begin(), et = end(); it != et; ++it) {
(*it)->drawT(pain, x, y); (*it)->drawT(pain, x, y);
//x += (*it->width_; //x += (*it)->width_;
x += 2; x += 2;
} }
} }

View File

@ -907,7 +907,6 @@ void MathNestInset::lfunMousePress(LCursor & cur, FuncRequest & cmd)
if (cmd.button() == mouse_button::button1) { if (cmd.button() == mouse_button::button1) {
first_x = cmd.x; first_x = cmd.x;
first_y = cmd.y; first_y = cmd.y;
//cur.setScreenPos(cmd.x + xo_, cmd.y + yo_);
lyxerr << "lfunMousePress: setting cursor to: " << cur << endl; lyxerr << "lfunMousePress: setting cursor to: " << cur << endl;
cur.resetAnchor(); cur.resetAnchor();
cur.bv().cursor() = cur; cur.bv().cursor() = cur;

View File

@ -62,8 +62,7 @@ void MathUnknownInset::draw(PainterInfo & pi, int x, int y) const
drawStrBlack(pi, x, y, name_); drawStrBlack(pi, x, y, name_);
else else
drawStrRed(pi, x, y, name_); drawStrRed(pi, x, y, name_);
xo_ = x; setPosCache(pi, x, y);
yo_ = y;
} }