diff --git a/src/Cursor.cpp b/src/Cursor.cpp index 6514a2b344..11c04691f9 100644 --- a/src/Cursor.cpp +++ b/src/Cursor.cpp @@ -2551,6 +2551,8 @@ void Cursor::checkBufferStructure() void Cursor::moveToClosestEdge(int const x, bool const edit) { if (Inset const * inset = nextInset()) { + // This is only used in mathed. + LATTEST(inset->asInsetMath()); // stay in front of insets for which we want to open the dialog // (e.g. InsetMathSpace). if (edit && (inset->hasSettings() || !inset->contextMenuName().empty())) diff --git a/src/RowPainter.cpp b/src/RowPainter.cpp index e84343a7aa..b6bf9a64ef 100644 --- a/src/RowPainter.cpp +++ b/src/RowPainter.cpp @@ -125,10 +125,9 @@ void RowPainter::paintInset(Row::Element const & e) const pi_.selected = pi_selected; #ifdef DEBUG_METRICS - Dimension const & dim = pi_.base.bv->coordCache().insets().dim(e.inset); - int const x2 = x1 + dim.wid; - int const y1 = yo_ + dim.des; - int const y2 = yo_ - dim.asc; + int const x2 = x1 + e.dim.wid; + int const y1 = yo_ + e.dim.des; + int const y2 = yo_ - e.dim.asc; pi_.pain.line(x1, y1, x1, y2, Color_green); pi_.pain.line(x1, y1, x2, y1, Color_green); pi_.pain.line(x2, y1, x2, y2, Color_green);