I tracked down the reason why the dot of \dot{m} isn't drawn.
The attached, diagnostic patch demostrates that the 'x' passed to
mathed_draw_deco is uninitialised for a math inset '\dot{m}'
Typical output:
mathed_draw_deco "dot", x=271716953, y=646, w=6, h=6
mathed_draw_deco ptr = 0x120525a38
drew line xx=2.4, yy=3, x2 = 3.6, y2 = 3
271716955, 649, 271716957, 649
I don't have valgrind here, so am giving up. If someone wants to
squash this bug, then be my guest...
Incidentally, Andre, the patch also adds a setPosCache call to
MathDotsInset::draw. I don't know if that is needed, but you seemed
to add a lot of these recently?
Some documentation of the function might help...
--
Angus
Index: src/mathed/math_dotsinset.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_dotsinset.C,v
retrieving revision 1.45
diff -u -p -r1.45 math_dotsinset.C
--- src/mathed/math_dotsinset.C 6 Oct 2003 15:43:12 -0000 1.45
+++ src/mathed/math_dotsinset.C 8 Apr 2004 13:50:19 -0000
@@ -61,6 +61,7 @@ void MathDotsInset::draw(PainterInfo & p
--y;
mathed_draw_deco(pain, x + 2, y - dh_, dim_.width() - 2, dim_.ascent(),
key_->name);
+ setPosCache(pain, x, y);
}
Index: src/mathed/math_support.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_support.C,v
retrieving revision 1.89
diff -u -p -r1.89 math_support.C
--- src/mathed/math_support.C 7 Apr 2004 13:15:34 -0000 1.89
+++ src/mathed/math_support.C 8 Apr 2004 13:50:19 -0000
@@ -413,6 +413,11 @@ int mathed_string_width(LyXFont const &
void mathed_draw_deco(PainterInfo & pi, int x, int y, int w, int h,
string const & name)
{
+ lyxerr << "mathed_draw_deco \""
+ << name << "\", x=" << x << ", y=" << y
+ << ", w=" << w << ", h=" << h
+ << std::endl;
+
if (name == ".") {
pi.pain.line(x + w/2, y, x + w/2, y + h,
LColor::cursor, Painter::line_onoffdash);
@@ -433,6 +438,7 @@ void mathed_draw_deco(PainterInfo & pi,
if (h > 70 && (name == "(" || name == ")"))
d = parenthHigh;
+ lyxerr << "mathed_draw_deco ptr = " << d << std::endl;
Matrix mt(r, w, h);
Matrix sqmt(r, n, n);
@@ -458,7 +464,15 @@ void mathed_draw_deco(PainterInfo & pi,
int(x + xx + 0.5), int(y + yy + 0.5),
int(x + x2 + 0.5), int(y + y2 + 0.5),
LColor::math);
- } else {
+
+ lyxerr << "drew line "
+ << "xx=" << xx << ", yy=" << yy
+ << ", x2 = " << x2 << ", y2 = " << y2 << '\n'
+ << int(x + xx + 0.5) << ", "
+ << int(y + yy + 0.5) << ", "
+ << int(x + x2 + 0.5) << ", "
+ << int(y + y2 + 0.5) << std::endl;
+ } else {
int xp[32];
int yp[32];
int const n = int(d[i++]);