]> git.lyx.org Git - features.git/commitdiff
Revert "Makes caret height adapt to context in mathed."
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 20 Apr 2018 07:51:35 +0000 (09:51 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 20 Apr 2018 07:59:45 +0000 (09:59 +0200)
This will be replaced by a different solution.

This reverts commit c5ca503d92a25dc168f84b9d7c008c390f434667.

src/BufferView.cpp
src/mathed/MathData.cpp

index 27176b350a48f677b68d5a804bd3d561af0f2ecf..819b478b9884a0b6f3991a1857a0cd88daac89e2 100644 (file)
@@ -2993,16 +2993,8 @@ void BufferView::caretPosAndHeight(Point & p, int & h) const
        Cursor const & cur = cursor();
        Font const font = cur.real_current_font;
        frontend::FontMetrics const & fm = theFontMetrics(font);
-       int asc = fm.maxAscent();
-       int des = fm.maxDescent();
-       // If the cursor is in mathed and it has cached metrics, reduce
-       // the height to fit the inner cell (mathed cells are tight
-       // vertically).
-       if (cur.inMathed() && coordCache().getArrays().hasDim(&cur.cell())) {
-               Dimension const dim = cur.cell().dimension(*this);
-               asc = min(asc, dim.asc);
-               des = min(des, dim.des);
-       }
+       int const asc = fm.maxAscent();
+       int const des = fm.maxDescent();
        h = asc + des;
        p = getPos(cur);
        p.y_ -= asc;
index 96aef294918da19d5978cc72541cbb21676ec753..d242a86f72c2d228c16a6a98b399e9457d4251a9 100644 (file)
@@ -261,15 +261,6 @@ bool isInside(DocIterator const & it, MathData const & ar,
 
 void MathData::metrics(MetricsInfo & mi, Dimension & dim) const
 {
-       // This is the only point where the drawing font is known.
-       // We set cursor current font so that the blinking caret height
-       // adapts to math font.
-       Cursor & cur = mi.base.bv->cursor();
-       if (cur.inMathed() && &cur.cell() == this) {
-               cur.current_font.fontInfo() = mi.base.font;
-               cur.real_current_font.fontInfo() = mi.base.font;
-       }
-
        frontend::FontMetrics const & fm = theFontMetrics(mi.base.font);
        dim = fm.dimension('I');
        int xascent = fm.dimension('x').ascent();