getCursorPos() formulabase.C

2002-04-15 Thread Juergen Vigna

Andre',

the mathed insets are returning wrong values for this function. Please
head that the values should be relative to the inset position or inside
the inset they should be absolute to itself!

You now return absolut position which is wrong. Try to change buffer while
inside a mathed inset you'll see that the position is not restored correctly!

   Jug

--
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._
Dr. Jürgen VignaE-Mail:  [EMAIL PROTECTED]
Italienallee 13/N   Tel/Fax: +39-0471-450260 / +39-0471-450253
I-39100 Bozen   Web: http://www.sad.it/~jug
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._

You will give someone a piece of your mind, which you can ill afford.




Re: getCursorPos() formulabase.C

2002-04-15 Thread Andre Poenitz

On Mon, Apr 15, 2002 at 11:40:27AM +0200, Juergen Vigna wrote:
 the mathed insets are returning wrong values for this function. Please
 head that the values should be relative to the inset position or inside
 the inset they should be absolute to itself!

I don't understand the 'or' part:

Currently, each inset stores the position where it got drawn last time
(in xo_, yo_) and  getCursorPos returns this. 
 
 You now return absolut position which is wrong.

I see. But if I simply subtract xo_, yo_, behaviour does not really change,
so I guess there is something else wrong.

Andre'

-- 
Those who desire to give up Freedom in order to gain Security,
will not have, nor do they deserve, either one. (T. Jefferson)



Re: getCursorPos() formulabase.C

2002-04-15 Thread Juergen Vigna


On 15-Apr-2002 Andre Poenitz wrote:

 I see. But if I simply subtract xo_, yo_, behaviour does not really change,
 so I guess there is something else wrong.

Well it's easy to test. If an outside program calls getCursorPos(bv, x, y)
and then calls inset-edit(bv, x, y, 0) the cursor should be on the same
position. Got it?

 Jug

P.S.: There is something strange with your mailer as I still get your mails
  double, did you check?

--
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._
Dr. Jürgen VignaE-Mail:  [EMAIL PROTECTED]
Italienallee 13/N   Tel/Fax: +39-0471-450260 / +39-0471-450253
I-39100 Bozen   Web: http://www.sad.it/~jug
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._

A lady is one who never shows her underwear unintentionally.
-- Lillian Day




Re: getCursorPos() formulabase.C

2002-04-15 Thread Andre Poenitz

On Mon, Apr 15, 2002 at 12:48:31PM +0200, Juergen Vigna wrote:
  I see. But if I simply subtract xo_, yo_, behaviour does not really change,
  so I guess there is something else wrong.
 
 Well it's easy to test. If an outside program calls getCursorPos(bv, x, y)
 and then calls inset-edit(bv, x, y, 0) the cursor should be on the same
 position. Got it?

Hm... sort of.

Of course mathed has ignored the x and y parameters of edit(bv, x, y, ...)
from the Beginning of the World.

So these are important?


 P.S.: There is something strange with your mailer as I still get your mails
   double, did you check?

No no... it works as it should. I told him to send you a duplicate.

Andre'

-- 
Those who desire to give up Freedom in order to gain Security,
will not have, nor do they deserve, either one. (T. Jefferson)



Re: getCursorPos() formulabase.C

2002-04-15 Thread Juergen Vigna


On 15-Apr-2002 Andre Poenitz wrote:

 Of course mathed has ignored the x and y parameters of edit(bv, x, y, ...)
 from the Beginning of the World.
 
 So these are important?

It seems so ;) Anyway I don't think you ignore them completely otherwise
you couldn't see if you entered from behind or not, isn't it?

 P.S.: There is something strange with your mailer as I still get your mails
   double, did you check?
 
 No no... it works as it should. I told him to send you a duplicate.

#:O)

Jug

--
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._
Dr. Jürgen VignaE-Mail:  [EMAIL PROTECTED]
Italienallee 13/N   Tel/Fax: +39-0471-450260 / +39-0471-450253
I-39100 Bozen   Web: http://www.sad.it/~jug
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._

Ad astra per aspera.
[To the stars by aspiration.]




Re: getCursorPos() formulabase.C

2002-04-15 Thread Andre Poenitz


Could you check whether the attached patch makes a difference?

Andre'

-- 
Those who desire to give up Freedom in order to gain Security,
will not have, nor do they deserve, either one. (T. Jefferson)


Index: formulabase.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/formulabase.C,v
retrieving revision 1.146
diff -u -p -r1.146 formulabase.C
--- formulabase.C   15 Apr 2002 08:50:20 -  1.146
+++ formulabase.C   15 Apr 2002 12:31:03 -
 -152,15 +152,16  string const InsetFormulaBase::editMessa
 }
 
 
-void InsetFormulaBase::edit(BufferView * bv, int x, int /*y*/, unsigned int)
+void InsetFormulaBase::edit(BufferView * bv, int x, int y, unsigned int)
 {
-   //lyxerr  edit:   x  y   button:   button  \n;
if (!bv-lockInset(this))
lyxerr[Debug::MATHED]  Cannot lock inset!!!  endl;
-
-   if (!mathcursor)
-   mathcursor = new MathCursor(this, x == 0);
+   delete mathcursor;
+   mathcursor = new MathCursor(this, true);
metrics(bv);
+   mathcursor-setPos(x, y);
+   //lyxerr  setting pos to   x  ,  y  \n;
+   
// if that is removed, we won't get the magenta box when entering an
// inset for the first time
bv-updateInset(this, false);
 -169,8 +170,12  void InsetFormulaBase::edit(BufferView *
 
 void InsetFormulaBase::edit(BufferView * bv, bool front)
 {
-   // looks hackish but seems to work
-   edit(bv, front ? 0 : 1, 0, 0);
+   if (!bv-lockInset(this))
+   lyxerr[Debug::MATHED]  Cannot lock inset!!!  endl;
+   delete mathcursor;
+   mathcursor = new MathCursor(this, front);
+   metrics(bv);
+   bv-updateInset(this, false);
 }
 
 
 -191,8 +196,8  void InsetFormulaBase::insetUnlock(Buffe
 void InsetFormulaBase::getCursorPos(BufferView *, int  x, int  y) const
 {
mathcursor-getPos(x, y);
-   x += xo_;
-   y += yo_;
+   //x -= xo_;
+   y -= yo_;
//lyxerr  getCursorPos:   x y  \n;
 }
 
 -298,10 +303,9  void InsetFormulaBase::insetButtonPress(
default:
case 1:
// left click
-   if (!mathcursor) {
-   mathcursor = new MathCursor(this, x == 0);
-   metrics(bv);
-   } 
+   delete mathcursor;
+   mathcursor = new MathCursor(this, x == 0);
+   metrics(bv);
first_x = x;
first_y = y;
mathcursor-selClear();



Re: getCursorPos() formulabase.C

2002-04-15 Thread Juergen Vigna


On 15-Apr-2002 Andre Poenitz wrote:
 
 Could you check whether the attached patch makes a difference?

Well yes it works on Buffer change now, but the values are still wrong,
you just compensate them in the edit() call now! Practically you would
have to use the x/y code you use in ::insetButtonPress()! So if I get
edit(bv, 0, 0, 0) then it's the start of the inset!

You didn't understand the relative x/y problem I explained in my first
mail, isn't it?

I try it with other words a math inset in the middle of a row (which say
starts at x position 200) will have as x position in the call to edit AND
insetButtonPress 0 if I press BEFORE the first character INSIDE the inset.

Hope this is clearer,

 Jug

--
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._
Dr. Jürgen VignaE-Mail:  [EMAIL PROTECTED]
Italienallee 13/N   Tel/Fax: +39-0471-450260 / +39-0471-450253
I-39100 Bozen   Web: http://www.sad.it/~jug
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._

Before borrowing money from a friend, decide which you need more.
-- Addison H. Hallock




Re: getCursorPos() formulabase.C

2002-04-15 Thread Andre Poenitz

On Mon, Apr 15, 2002 at 03:14:19PM +0200, Juergen Vigna wrote:
 Well yes it works on Buffer change now, but the values are still wrong,
 you just compensate them in the edit() call now!

Aehm, since this 'fixes' this case now, should I commit it?

Andre'

-- 
Those who desire to give up Freedom in order to gain Security,
will not have, nor do they deserve, either one. (T. Jefferson)



Re: getCursorPos() formulabase.C

2002-04-15 Thread Juergen Vigna


On 15-Apr-2002 Andre Poenitz wrote:

 I try it with other words a math inset in the middle of a row (which say
 starts at x position 200) will have as x position in the call to edit AND
 insetButtonPress 0 if I press BEFORE the first character INSIDE the inset.
 
 Does this mean, mathed can be ignorant to any outside positioning? I.e. I
 can assume all parameters send to mathed methods are 'normalized', i.e.
 assume an origin of the inset in (0,0)? This would be nice...

Yes and as much as I know this has been so since a long time!

 Ok, then all the xo_/yo_ handling in mathed is Wrong, since it stores
 absolute values everywhere, not relative to the inset's origin.
 
 This is not exactly my doing and maybe was not even possible to do
 otherwise until this recent change of yours that allowed me to remove this
 awful hack for cursor positioning...

I don't know about that you have to see it. Where do you get the absolute
postions from? Anyway you need absolute position only for drawing but then
you get the x and baseline there so that should be no problem!

 But the question is: How important is it to get this right? I probably
 would have to touch a dozen math insets to switch from absolute positions
 to relative...

Well if you want to have the cursor on the right x spot when doing a
cursor up/down (I'm fixing this at this moment and therefore I've seen
that mathed does it wrong and InsetText did is also wrong!) then you
should fix it. If you don't care that the cursor goes to the end of the
next/previous row on a cursor up/down and can handle all the requests
coming from the user because of this strange behaviour then let it be ;)

Anyway it's just 1 function to fix in which you return the normalized values
to the outside world. Why would you have to fix this in a lot of functions?

A well there is the edit call too but that should be really easy to fix.

   Jug
--
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._
Dr. Jürgen VignaE-Mail:  [EMAIL PROTECTED]
Italienallee 13/N   Tel/Fax: +39-0471-450260 / +39-0471-450253
I-39100 Bozen   Web: http://www.sad.it/~jug
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._

Aliquid melius quam pessimum optimum non est.




Re: getCursorPos() formulabase.C

2002-04-15 Thread Juergen Vigna


On 15-Apr-2002 Andre Poenitz wrote:
 On Mon, Apr 15, 2002 at 03:14:19PM +0200, Juergen Vigna wrote:
 Well yes it works on Buffer change now, but the values are still wrong,
 you just compensate them in the edit() call now!
 
 Aehm, since this 'fixes' this case now, should I commit it?

It depends on the answer to my other mail! You decide I don't care ;)
We can just open a Bug on this and you tell us you fix it in 1.3.

  Jug

--
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._
Dr. Jürgen VignaE-Mail:  [EMAIL PROTECTED]
Italienallee 13/N   Tel/Fax: +39-0471-450260 / +39-0471-450253
I-39100 Bozen   Web: http://www.sad.it/~jug
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._

A good plan today is better than a perfect plan tomorrow.
-- Patton




Re: getCursorPos() formulabase.C

2002-04-15 Thread Andre Poenitz

On Mon, Apr 15, 2002 at 03:52:57PM +0200, Juergen Vigna wrote:
 I don't know about that you have to see it. Where do you get the absolute
 postions from?

The absolute positions are cached from the last drawing. That has been the
main source of mathed specific redrawing problems, so I'd be more than
happy to get rid of this cache.

 Anyway you need absolute position only for drawing but then
 you get the x and baseline there so that should be no problem!

Indeed. That's all what is needed.
 
 Well if you want to have the cursor on the right x spot when doing a
 cursor up/down (I'm fixing this at this moment and therefore I've seen
 that mathed does it wrong and InsetText did is also wrong!) then you
 should fix it. If you don't care that the cursor goes to the end of the
 next/previous row on a cursor up/down and can handle all the requests
 coming from the user because of this strange behaviour then let it be ;)

Cursor up/down by keeping the x part is used as a kind of fall-back in
mathed when all clever method fail. 
 
 Anyway it's just 1 function to fix in which you return the normalized values
 to the outside world. Why would you have to fix this in a lot of functions?

I'll have a look. I thought I would have to change the drawing stuff. But
then, these get the absolute values already, so maybe it's easier to fix
than I thought.

Andre'

-- 
Those who desire to give up Freedom in order to gain Security,
will not have, nor do they deserve, either one. (T. Jefferson)



getCursorPos() & formulabase.C

2002-04-15 Thread Juergen Vigna

Andre',

the mathed insets are returning wrong values for this function. Please
head that the values should be relative to the inset position or inside
the inset they should be absolute to itself!

You now return absolut position which is wrong. Try to change buffer while
inside a mathed inset you'll see that the position is not restored correctly!

   Jug

--
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._
Dr. Jürgen VignaE-Mail:  [EMAIL PROTECTED]
Italienallee 13/N   Tel/Fax: +39-0471-450260 / +39-0471-450253
I-39100 Bozen   Web: http://www.sad.it/~jug
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._

You will give someone a piece of your mind, which you can ill afford.




Re: getCursorPos() & formulabase.C

2002-04-15 Thread Andre Poenitz

On Mon, Apr 15, 2002 at 11:40:27AM +0200, Juergen Vigna wrote:
> the mathed insets are returning wrong values for this function. Please
> head that the values should be relative to the inset position or inside
> the inset they should be absolute to itself!

I don't understand the 'or' part:

Currently, each inset stores the position where it got drawn last time
(in xo_, yo_) and  getCursorPos returns this. 
 
> You now return absolut position which is wrong.

I see. But if I simply subtract xo_, yo_, behaviour does not really change,
so I guess there is something else wrong.

Andre'

-- 
Those who desire to give up Freedom in order to gain Security,
will not have, nor do they deserve, either one. (T. Jefferson)



Re: getCursorPos() & formulabase.C

2002-04-15 Thread Juergen Vigna


On 15-Apr-2002 Andre Poenitz wrote:

> I see. But if I simply subtract xo_, yo_, behaviour does not really change,
> so I guess there is something else wrong.

Well it's easy to test. If an outside program calls getCursorPos(bv, x, y)
and then calls inset->edit(bv, x, y, 0) the cursor should be on the same
position. Got it?

 Jug

P.S.: There is something strange with your mailer as I still get your mails
  double, did you check?

--
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._
Dr. Jürgen VignaE-Mail:  [EMAIL PROTECTED]
Italienallee 13/N   Tel/Fax: +39-0471-450260 / +39-0471-450253
I-39100 Bozen   Web: http://www.sad.it/~jug
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._

A lady is one who never shows her underwear unintentionally.
-- Lillian Day




Re: getCursorPos() & formulabase.C

2002-04-15 Thread Andre Poenitz

On Mon, Apr 15, 2002 at 12:48:31PM +0200, Juergen Vigna wrote:
> > I see. But if I simply subtract xo_, yo_, behaviour does not really change,
> > so I guess there is something else wrong.
> 
> Well it's easy to test. If an outside program calls getCursorPos(bv, x, y)
> and then calls inset->edit(bv, x, y, 0) the cursor should be on the same
> position. Got it?

Hm... sort of.

Of course mathed has ignored the x and y parameters of edit(bv, x, y, ...)
from the Beginning of the World.

So these are important?


> P.S.: There is something strange with your mailer as I still get your mails
>   double, did you check?

No no... it works as it should. I told him to send you a duplicate.

Andre'

-- 
Those who desire to give up Freedom in order to gain Security,
will not have, nor do they deserve, either one. (T. Jefferson)



Re: getCursorPos() & formulabase.C

2002-04-15 Thread Juergen Vigna


On 15-Apr-2002 Andre Poenitz wrote:

> Of course mathed has ignored the x and y parameters of edit(bv, x, y, ...)
> from the Beginning of the World.
> 
> So these are important?

It seems so ;) Anyway I don't think you ignore them completely otherwise
you couldn't see if you entered from behind or not, isn't it?

>> P.S.: There is something strange with your mailer as I still get your mails
>>   double, did you check?
> 
> No no... it works as it should. I told him to send you a duplicate.

#:O)

Jug

--
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._
Dr. Jürgen VignaE-Mail:  [EMAIL PROTECTED]
Italienallee 13/N   Tel/Fax: +39-0471-450260 / +39-0471-450253
I-39100 Bozen   Web: http://www.sad.it/~jug
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._

Ad astra per aspera.
[To the stars by aspiration.]




Re: getCursorPos() & formulabase.C

2002-04-15 Thread Andre Poenitz


Could you check whether the attached patch makes a difference?

Andre'

-- 
Those who desire to give up Freedom in order to gain Security,
will not have, nor do they deserve, either one. (T. Jefferson)


Index: formulabase.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/formulabase.C,v
retrieving revision 1.146
diff -u -p -r1.146 formulabase.C
--- formulabase.C   15 Apr 2002 08:50:20 -  1.146
+++ formulabase.C   15 Apr 2002 12:31:03 -
@@ -152,15 +152,16 @@ string const InsetFormulaBase::editMessa
 }
 
 
-void InsetFormulaBase::edit(BufferView * bv, int x, int /*y*/, unsigned int)
+void InsetFormulaBase::edit(BufferView * bv, int x, int y, unsigned int)
 {
-   //lyxerr << "edit: " << x  << " " << y << " button: " << button << "\n";
if (!bv->lockInset(this))
lyxerr[Debug::MATHED] << "Cannot lock inset!!!" << endl;
-
-   if (!mathcursor)
-   mathcursor = new MathCursor(this, x == 0);
+   delete mathcursor;
+   mathcursor = new MathCursor(this, true);
metrics(bv);
+   mathcursor->setPos(x, y);
+   //lyxerr << "setting pos to " << x << "," << y << "\n";
+   
// if that is removed, we won't get the magenta box when entering an
// inset for the first time
bv->updateInset(this, false);
@@ -169,8 +170,12 @@ void InsetFormulaBase::edit(BufferView *
 
 void InsetFormulaBase::edit(BufferView * bv, bool front)
 {
-   // looks hackish but seems to work
-   edit(bv, front ? 0 : 1, 0, 0);
+   if (!bv->lockInset(this))
+   lyxerr[Debug::MATHED] << "Cannot lock inset!!!" << endl;
+   delete mathcursor;
+   mathcursor = new MathCursor(this, front);
+   metrics(bv);
+   bv->updateInset(this, false);
 }
 
 
@@ -191,8 +196,8 @@ void InsetFormulaBase::insetUnlock(Buffe
 void InsetFormulaBase::getCursorPos(BufferView *, int & x, int & y) const
 {
mathcursor->getPos(x, y);
-   x += xo_;
-   y += yo_;
+   //x -= xo_;
+   y -= yo_;
//lyxerr << "getCursorPos: " << x << " " << y << "\n";
 }
 
@@ -298,10 +303,9 @@ void InsetFormulaBase::insetButtonPress(
default:
case 1:
// left click
-   if (!mathcursor) {
-   mathcursor = new MathCursor(this, x == 0);
-   metrics(bv);
-   } 
+   delete mathcursor;
+   mathcursor = new MathCursor(this, x == 0);
+   metrics(bv);
first_x = x;
first_y = y;
mathcursor->selClear();



Re: getCursorPos() & formulabase.C

2002-04-15 Thread Juergen Vigna


On 15-Apr-2002 Andre Poenitz wrote:
> 
> Could you check whether the attached patch makes a difference?

Well yes it works on Buffer change now, but the values are still wrong,
you just compensate them in the edit() call now! Practically you would
have to use the x/y code you use in ::insetButtonPress()! So if I get
edit(bv, 0, 0, 0) then it's the start of the inset!

You didn't understand the "relative" x/y problem I explained in my first
mail, isn't it?

I try it with other words a math inset in the middle of a row (which say
starts at x position 200) will have as x position in the call to edit AND
insetButtonPress 0 if I press BEFORE the first character INSIDE the inset.

Hope this is clearer,

 Jug

--
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._
Dr. Jürgen VignaE-Mail:  [EMAIL PROTECTED]
Italienallee 13/N   Tel/Fax: +39-0471-450260 / +39-0471-450253
I-39100 Bozen   Web: http://www.sad.it/~jug
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._

Before borrowing money from a friend, decide which you need more.
-- Addison H. Hallock




Re: getCursorPos() & formulabase.C

2002-04-15 Thread Andre Poenitz

On Mon, Apr 15, 2002 at 03:14:19PM +0200, Juergen Vigna wrote:
> Well yes it works on Buffer change now, but the values are still wrong,
> you just compensate them in the edit() call now!

Aehm, since this 'fixes' this case now, should I commit it?

Andre'

-- 
Those who desire to give up Freedom in order to gain Security,
will not have, nor do they deserve, either one. (T. Jefferson)



Re: getCursorPos() & formulabase.C

2002-04-15 Thread Juergen Vigna


On 15-Apr-2002 Andre Poenitz wrote:

>> I try it with other words a math inset in the middle of a row (which say
>> starts at x position 200) will have as x position in the call to edit AND
>> insetButtonPress 0 if I press BEFORE the first character INSIDE the inset.
> 
> Does this mean, mathed can be ignorant to any outside positioning? I.e. I
> can assume all parameters send to mathed methods are 'normalized', i.e.
> assume an origin of the inset in (0,0)? This would be nice...

Yes and as much as I know this has been so since a long time!

> Ok, then all the xo_/yo_ handling in mathed is Wrong, since it stores
> absolute values everywhere, not relative to the inset's origin.
> 
> This is not exactly my doing and maybe was not even possible to do
> otherwise until this recent change of yours that allowed me to remove this
> awful hack for cursor positioning...

I don't know about that you have to see it. Where do you get the absolute
postions from? Anyway you need absolute position only for drawing but then
you get the x and baseline there so that should be no problem!

> But the question is: How important is it to get this right? I probably
> would have to touch a dozen math insets to switch from absolute positions
> to relative...

Well if you want to have the cursor on the right x spot when doing a
cursor up/down (I'm fixing this at this moment and therefore I've seen
that mathed does it wrong and InsetText did is also wrong!) then you
should fix it. If you don't care that the cursor goes to the end of the
next/previous row on a cursor up/down and can handle all the requests
coming from the user because of this strange behaviour then let it be ;)

Anyway it's just 1 function to fix in which you return the normalized values
to the outside world. Why would you have to fix this in a lot of functions?

A well there is the edit call too but that should be really easy to fix.

   Jug
--
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._
Dr. Jürgen VignaE-Mail:  [EMAIL PROTECTED]
Italienallee 13/N   Tel/Fax: +39-0471-450260 / +39-0471-450253
I-39100 Bozen   Web: http://www.sad.it/~jug
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._

Aliquid melius quam pessimum optimum non est.




Re: getCursorPos() & formulabase.C

2002-04-15 Thread Juergen Vigna


On 15-Apr-2002 Andre Poenitz wrote:
> On Mon, Apr 15, 2002 at 03:14:19PM +0200, Juergen Vigna wrote:
>> Well yes it works on Buffer change now, but the values are still wrong,
>> you just compensate them in the edit() call now!
> 
> Aehm, since this 'fixes' this case now, should I commit it?

It depends on the answer to my other mail! You decide I don't care ;)
We can just open a Bug on this and you tell us you fix it in 1.3.

  Jug

--
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._
Dr. Jürgen VignaE-Mail:  [EMAIL PROTECTED]
Italienallee 13/N   Tel/Fax: +39-0471-450260 / +39-0471-450253
I-39100 Bozen   Web: http://www.sad.it/~jug
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._

A good plan today is better than a perfect plan tomorrow.
-- Patton




Re: getCursorPos() & formulabase.C

2002-04-15 Thread Andre Poenitz

On Mon, Apr 15, 2002 at 03:52:57PM +0200, Juergen Vigna wrote:
> I don't know about that you have to see it. Where do you get the absolute
> postions from?

The absolute positions are cached from the last drawing. That has been the
main source of mathed specific redrawing problems, so I'd be more than
happy to get rid of this cache.

> Anyway you need absolute position only for drawing but then
> you get the x and baseline there so that should be no problem!

Indeed. That's all what is needed.
 
> Well if you want to have the cursor on the right x spot when doing a
> cursor up/down (I'm fixing this at this moment and therefore I've seen
> that mathed does it wrong and InsetText did is also wrong!) then you
> should fix it. If you don't care that the cursor goes to the end of the
> next/previous row on a cursor up/down and can handle all the requests
> coming from the user because of this strange behaviour then let it be ;)

Cursor up/down by "keeping the x part" is used as a kind of fall-back in
mathed when all "clever" method fail. 
 
> Anyway it's just 1 function to fix in which you return the normalized values
> to the outside world. Why would you have to fix this in a lot of functions?

I'll have a look. I thought I would have to change the drawing stuff. But
then, these get the absolute values already, so maybe it's easier to fix
than I thought.

Andre'

-- 
Those who desire to give up Freedom in order to gain Security,
will not have, nor do they deserve, either one. (T. Jefferson)