// insert a one pixel gap in front of the formula
dim.wid += 1;
if (display())
- dim.des += 12;
+ dim.des += displayMargin();
dim_ = dim;
return;
}
MathGridInset::metrics(mi, dim);
if (display()) {
- dim.asc += 12;
- dim.des += 12;
+ dim.asc += displayMargin();
+ dim.des += displayMargin();
}
if (numberedType()) {
#include "insets/insetenv.h"
+#include "mathed/math_hullinset.h"
+
#include "support/textutils.h"
#include <boost/current_function.hpp>
if (!cur.selection()) {
int const y = bv_funcs::getPos(cur, cur.boundary()).y_;
LCursor old = cur;
- editXY(cur, x, y - par.rows()[row].ascent() - 1);
+ // Go to middle of previous row. 16 found to work OK;
+ // 12 = top/bottom margin of display math
+ int const margin = 3 * MathHullInset::displayMargin() / 2;
+ editXY(cur, x, y - par.rows()[row].ascent() - margin);
cur.clearSelection();
// This happens when you move out of an inset.
if (!cur.selection()) {
int const y = bv_funcs::getPos(cur, cur.boundary()).y_;
LCursor old = cur;
- editXY(cur, x, y + par.rows()[row].descent() + 1);
+ // To middle of next row
+ int const margin = 3 * MathHullInset::displayMargin() / 2;
+ editXY(cur, x, y + par.rows()[row].descent() + margin);
cur.clearSelection();
// This happens when you move out of an inset.