+2006-01-27 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
+
+ * math_nestinset.C (drawSelection): do not draw anything when
+ there is no selection; when drawing, do it with the null painter,
+ since only the metrics matter (fixes bug1934).
+
2006-01-18 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* math_factory.C (initMath): set initialized to true early to
#include "frontends/Dialogs.h"
#include "frontends/LyXView.h"
#include "frontends/Painter.h"
+#include "frontends/nullpainter.h"
#include <sstream>
void MathNestInset::drawSelection(PainterInfo & pi, int x, int y) const
{
- // FIXME: hack to get position cache warm
- draw(pi, x, y);
-
// this should use the x/y values given, not the cached values
LCursor & cur = pi.base.bv->cursor();
if (!cur.selection())
if (!ptr_cmp(&cur.inset(), this))
return;
+ // FIXME: hack to get position cache warm
+ static NullPainter nop;
+ PainterInfo pinop(pi);
+ pinop.pain = nop;
+ draw(pinop, x, y);
+
CursorSlice s1 = cur.selBegin();
CursorSlice s2 = cur.selEnd();
//lyxerr << "MathNestInset::drawing selection: "