I made a locked field, and then put a mouseUp script that would respond to
clicks in a way that depended on the character the user was clicking on.

It kept giving the wrong results.  In the end I started testing, and it
seems that Rev is measuring, not from either edge of one character, but from
the middle of one character to the middle of the next.

It doesn't seem to be affected by margins, font size, or whether the font is
proportional or not.  The most telling is if you have a field with tabs in
and wide tab stops - the point at which the mouse is interpreted as being in
one character or another is varied according to the space occupied by the

Repro:

- new stack

- new field, locked, put a load of text in there

- add a field script:
    on mouseup
      get the selectedChunk
      select char (word 2 of it) of me
    end mouseup

- start clicking.  It's most obvious in a 'w' or 'm' - click in one half of
the character or the other.  Make the font bigger or smaller: results are
consistent.

I guess this makes sense if the field is unlocked, so when the mouse is
clicked Rev has to decide which two characters to place the insertion point
between - but it gives dodgy results in this case.  Most annoying, I can't
see any workarounds, short of throwing selectedChunk away and measuring all
the text in script, which is going to be sloooow.

  Ben Rubinstein               |  Email: [EMAIL PROTECTED]
  Cognitive Applications Ltd   |  Phone: +44 (0)1273-821600
  http://www.cogapp.com        |  Fax  : +44 (0)1273-728866

Reply via email to