mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-18 05:37:11 +00:00
Inset coords shall not be recorded in Inset::draw() because this can create problems with inheritance (which often modify the coords but not the Inset pointer itself). Right now there three kind of inset containers: paragraphs, tables and math arrays. The coords caching is fixed in the first two.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20376 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
c3fefae326
commit
4c82dd1fc8
@ -71,7 +71,6 @@ bool InsetCommand::setMouseHover(bool mouse_hover)
|
|||||||
|
|
||||||
void InsetCommand::draw(PainterInfo & pi, int x, int y) const
|
void InsetCommand::draw(PainterInfo & pi, int x, int y) const
|
||||||
{
|
{
|
||||||
setPosCache(pi, x, y);
|
|
||||||
button_.setRenderState(mouse_hover_);
|
button_.setRenderState(mouse_hover_);
|
||||||
button_.draw(pi, x, y);
|
button_.draw(pi, x, y);
|
||||||
}
|
}
|
||||||
|
@ -517,7 +517,6 @@ bool InsetExternal::metrics(MetricsInfo & mi, Dimension & dim) const
|
|||||||
|
|
||||||
void InsetExternal::draw(PainterInfo & pi, int x, int y) const
|
void InsetExternal::draw(PainterInfo & pi, int x, int y) const
|
||||||
{
|
{
|
||||||
setPosCache(pi, x, y);
|
|
||||||
renderer_->draw(pi, x, y);
|
renderer_->draw(pi, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,8 +110,6 @@ bool InsetFlex::metrics(MetricsInfo & mi, Dimension & dim) const
|
|||||||
|
|
||||||
void InsetFlex::draw(PainterInfo & pi, int x, int y) const
|
void InsetFlex::draw(PainterInfo & pi, int x, int y) const
|
||||||
{
|
{
|
||||||
setPosCache(pi, x, y);
|
|
||||||
|
|
||||||
Font tmpfont = pi.base.font;
|
Font tmpfont = pi.base.font;
|
||||||
getDrawFont(pi.base.font);
|
getDrawFont(pi.base.font);
|
||||||
// I don't understand why the above .reduce and .realize aren't
|
// I don't understand why the above .reduce and .realize aren't
|
||||||
|
@ -268,7 +268,6 @@ bool InsetGraphics::metrics(MetricsInfo & mi, Dimension & dim) const
|
|||||||
|
|
||||||
void InsetGraphics::draw(PainterInfo & pi, int x, int y) const
|
void InsetGraphics::draw(PainterInfo & pi, int x, int y) const
|
||||||
{
|
{
|
||||||
setPosCache(pi, x, y);
|
|
||||||
graphic_->draw(pi, x, y);
|
graphic_->draw(pi, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -816,8 +816,6 @@ bool InsetInclude::metrics(MetricsInfo & mi, Dimension & dim) const
|
|||||||
|
|
||||||
void InsetInclude::draw(PainterInfo & pi, int x, int y) const
|
void InsetInclude::draw(PainterInfo & pi, int x, int y) const
|
||||||
{
|
{
|
||||||
setPosCache(pi, x, y);
|
|
||||||
|
|
||||||
BOOST_ASSERT(pi.base.bv);
|
BOOST_ASSERT(pi.base.bv);
|
||||||
|
|
||||||
bool use_preview = false;
|
bool use_preview = false;
|
||||||
|
@ -263,7 +263,6 @@ void InsetQuotes::draw(PainterInfo & pi, int x, int y) const
|
|||||||
} else {
|
} else {
|
||||||
pi.pain.text(x, y, text, pi.base.font);
|
pi.pain.text(x, y, text, pi.base.font);
|
||||||
}
|
}
|
||||||
setPosCache(pi, x, y);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2994,8 +2994,6 @@ bool InsetTabular::metrics(MetricsInfo & mi, Dimension & dim) const
|
|||||||
|
|
||||||
void InsetTabular::draw(PainterInfo & pi, int x, int y) const
|
void InsetTabular::draw(PainterInfo & pi, int x, int y) const
|
||||||
{
|
{
|
||||||
setPosCache(pi, x, y);
|
|
||||||
|
|
||||||
//lyxerr << "InsetTabular::draw: " << x << " " << y << endl;
|
//lyxerr << "InsetTabular::draw: " << x << " " << y << endl;
|
||||||
BufferView * bv = pi.base.bv;
|
BufferView * bv = pi.base.bv;
|
||||||
|
|
||||||
@ -3022,6 +3020,8 @@ void InsetTabular::draw(PainterInfo & pi, int x, int y) const
|
|||||||
first_visible_cell = idx;
|
first_visible_cell = idx;
|
||||||
|
|
||||||
int const cx = nx + tabular.getBeginningOfTextInCell(idx);
|
int const cx = nx + tabular.getBeginningOfTextInCell(idx);
|
||||||
|
// Cache the Inset position.
|
||||||
|
bv->coordCache().insets().add(cell(idx).get(), cx, y);
|
||||||
if (nx + tabular.columnWidth(idx) < 0
|
if (nx + tabular.columnWidth(idx) < 0
|
||||||
|| nx > bv->workWidth()
|
|| nx > bv->workWidth()
|
||||||
|| y + d < 0
|
|| y + d < 0
|
||||||
@ -3047,8 +3047,6 @@ void InsetTabular::draw(PainterInfo & pi, int x, int y) const
|
|||||||
|
|
||||||
void InsetTabular::drawSelection(PainterInfo & pi, int x, int y) const
|
void InsetTabular::drawSelection(PainterInfo & pi, int x, int y) const
|
||||||
{
|
{
|
||||||
setPosCache(pi, x, y);
|
|
||||||
|
|
||||||
Cursor & cur = pi.base.bv->cursor();
|
Cursor & cur = pi.base.bv->cursor();
|
||||||
|
|
||||||
x += scx_ + ADD_TO_TABULAR_WIDTH;
|
x += scx_ + ADD_TO_TABULAR_WIDTH;
|
||||||
|
@ -146,8 +146,6 @@ bool InsetVSpace::metrics(MetricsInfo & mi, Dimension & dim) const
|
|||||||
|
|
||||||
void InsetVSpace::draw(PainterInfo & pi, int x, int y) const
|
void InsetVSpace::draw(PainterInfo & pi, int x, int y) const
|
||||||
{
|
{
|
||||||
setPosCache(pi, x, y);
|
|
||||||
|
|
||||||
x += ADD_TO_VSPACE_WIDTH;
|
x += ADD_TO_VSPACE_WIDTH;
|
||||||
|
|
||||||
int const start = y - dim_.asc;
|
int const start = y - dim_.asc;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user