Little bit more debug info for unset Buffer members.

This commit is contained in:
Richard Kimberly Heck 2024-04-18 16:03:14 -04:00
parent 9bd5d0b251
commit 7c140f743d
2 changed files with 6 additions and 2 deletions

View File

@ -193,9 +193,11 @@ ColorCode PainterInfo::backgroundColor(Inset const * inset, bool sel) const
// special handling for inset background
if (inset != nullptr) {
if (pain.develMode() && !inset->isBufferValid())
if (pain.develMode() && !inset->isBufferValid()) {
LYXERR0("Invalid or no buffer set in " << insetName(inset->lyxCode()));
// This inset is in error
return Color_error;
}
ColorCode const color_bg = inset->backgroundColor(*this);
if (color_bg != Color_none)

View File

@ -337,9 +337,11 @@ void MathRow::draw(PainterInfo & pi, int x, int const y) const
// while it is drawing, because it relies on this value.
Geometry & g = coords.insets().geometry(e.inset);
g.dim.wid -= e.before + e.after;
if (pi.pain.develMode() && !e.inset->isBufferValid())
if (pi.pain.develMode() && !e.inset->isBufferValid()) {
pi.pain.fillRectangle(x + e.before, y - g.dim.ascent(),
g.dim.width(), g.dim.height(), Color_error);
LYXERR0("Unset Buffer memeber in " << insetName(e.inset->lyxCode()));
}
e.inset->draw(pi, x + e.before, y);
g.pos = {x, y};
g.dim.wid += e.before + e.after;