]> git.lyx.org Git - lyx.git/commitdiff
Fixed setting cursor positions with mouse for TextInsets and CollapsableInsets.
authorJürgen Vigna <jug@sad.it>
Fri, 20 Apr 2001 14:54:25 +0000 (14:54 +0000)
committerJürgen Vigna <jug@sad.it>
Fri, 20 Apr 2001 14:54:25 +0000 (14:54 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1947 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/ChangeLog
src/insets/insetcollapsable.C
src/insets/insettext.C

index 18ed7f27d69871dc336dcb340317e6521102a369..1ae41b2a6beca3adbfd01efa3ef7966d000187db 100644 (file)
@@ -1,3 +1,7 @@
+2001-04-20  Juergen Vigna  <jug@sad.it>
+
+       * insettext.C (Edit): call checkAndActivateInset with y=0 if y < 0.
+
 2001-04-18  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
 
        * insetquotes.C (Latex): improve the guard against
index 6fcd31120ca89029a35633af4e5226288bead464..208a5fdf7bc2e41e622e23dc4479a831973a5705 100644 (file)
@@ -251,7 +251,7 @@ void InsetCollapsable::Edit(BufferView * bv, int xp, int yp,
        } else if (!collapsed) {
                if (!bv->lockInset(this))
                        return;
-               inset.Edit(bv, xp, yp+(top_baseline - inset.y()), button);
+               inset.Edit(bv, xp, yp + (top_baseline - inset.y()), button);
        }
 }
 
index cd18251615a89010490ee42a4ed24d114a474261..2d19e5e4ea630d9037a0e94e4f1d20e05439f545 100644 (file)
@@ -566,7 +566,8 @@ void InsetText::Edit(BufferView * bv, int x, int y, unsigned int button)
        inset_boundary = false;
        inset_par = 0;
        old_par = 0;
-       if (!checkAndActivateInset(bv, x, y, button))
+       int tmp_y = (y < 0)?0:y;
+       if (!checkAndActivateInset(bv, x, tmp_y, button))
                TEXT(bv)->SetCursorFromCoordinates(bv, x - drawTextXOffset,
                                                   y + insetAscent);
        TEXT(bv)->sel_cursor = TEXT(bv)->cursor;
@@ -737,7 +738,7 @@ void InsetText::InsetButtonPress(BufferView * bv, int x, int y, int button)
                        return;
                }
        }
-       if (!inset && (button == 2)) {
+       if (!inset) { // && (button == 2)) {
                bool paste_internally = false;
                if ((button == 2) && TEXT(bv)->selection) {
                        LocalDispatch(bv, LFUN_COPY, "");