Attached.

Now the cursor positioning is correct, and the crash is gone. Only price
to pay is that now you cannot enter the inner inset with the mouse, but
have to use the arrow keys. So this is a bit of a hack, but should be OK
to get 1.4 out the door ;-)

The problem seems to be, that if you click on the inset, the [green]
cell (cell 0) becomes visible and the x coordinate cache becomes
invalid, making the entry into the inset produce a crash. The arrow keys
don't use the cache in this way. I suspect this error is very similar to
Helge's macro one.

- Martin
Index: math_colorinset.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_colorinset.C,v
retrieving revision 1.11
diff -u -r1.11 math_colorinset.C
--- math_colorinset.C	4 Jan 2005 09:18:46 -0000	1.11
+++ math_colorinset.C	8 Apr 2005 08:50:47 -0000
@@ -64,6 +64,7 @@
 
 void MathColorInset::draw(PainterInfo & pi, int x, int y) const
 {
+	int const x0(x);
 	if (editing(pi.base.bv)) {
 		FontSetChanger dummy(pi.base, "textnormal");
 		drawMarkers(pi, x, y);
@@ -79,7 +80,8 @@
 	pi.base.font.setColor(lcolor.getFromGUIName(asString(cell(0))));
 	cell(1).draw(pi, x, y);
 	pi.base.font.setColor(origcol);
-	setPosCache(pi, x, y);
+	if (editing(pi.base.bv))
+		setPosCache(pi, x0, y);
 }
 
 

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to