Alfredo Braunstein wrote:

> it seems that coordinate detection of nested math insets are messed up for
> other than the first page of the document.
> 
> If you go scroll down you cannot click inside some nested math inset, the
> cursor is always stuck on the outer level.

This seems to fix most of it. For some reason, now \frac works ok, but \sqrt
or math-matrix still doesn't work.

Alfredo
Index: text2.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text2.C,v
retrieving revision 1.585
diff -u -p -u -r1.585 text2.C
--- text2.C	16 Aug 2004 00:32:00 -0000	1.585
+++ text2.C	24 Sep 2004 18:13:10 -0000
@@ -1210,12 +1210,12 @@ void LyXText::setCursorFromCoordinates(L
 }
 
 
-// x,y are absolute screen coordinates
+// x,y are screen coordinates
 // sets cursor recursively descending into nested editable insets
 InsetBase * LyXText::editXY(LCursor & cur, int x, int y) const
 {
 	par_type pit;
-	Row const & row = getRowNearY(y - yo_, pit);
+	Row const & row = getRowNearY(y + cur.bv().top_y() - yo_ , pit);
 	bool bound = false;
 
 	int xx = x; // is modified by getColumnNearX
@@ -1225,7 +1225,7 @@ InsetBase * LyXText::editXY(LCursor & cu
 	cur.boundary() = bound;
 
 	// try to descend into nested insets
-	InsetBase * inset = checkInsetHit(x, y);
+	InsetBase * inset = checkInsetHit(x, y + cur.bv().top_y());
 	lyxerr << "inset " << inset << " hit at x: " << x << " y: " << y << endl;
 	if (!inset)
 		return 0;
Index: BufferView_pimpl.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BufferView_pimpl.C,v
retrieving revision 1.555
diff -u -p -u -r1.555 BufferView_pimpl.C
--- BufferView_pimpl.C	14 Aug 2004 19:54:55 -0000	1.555
+++ BufferView_pimpl.C	24 Sep 2004 18:13:11 -0000
@@ -862,7 +862,6 @@ bool BufferView::Pimpl::workAreaDispatch
 		return true;
 	}
 
-	cmd.y += bv_->top_y();
 	if (!bv_->buffer())
 		return false;
 
@@ -888,6 +887,9 @@ bool BufferView::Pimpl::workAreaDispatch
 	lyxerr << " * hit inset at tip: " << inset << endl;
 	lyxerr << " * created temp cursor:" << cur << endl;
 
+
+	cmd.y += bv_->top_y();
+	
 	// Put anchor at the same position.
 	cur.resetAnchor();
 

Reply via email to