x,y position of the mousechunk ?
Mark Waddingham
mark at livecode.com
Tue May 5 08:50:18 EDT 2026
On 2026-05-04 14:40, jbv via use-livecode wrote:
> Hi list,
>
> Is there a way to know the x,y position of the mousechunk,
> especially when the content of a field is not just plain
> text, but HTMLtext with more that 1 line ?
>
> For the x value, I tried to use the formattedwidth of the
> portion of text given by the mousechunk.
> And for the y value, I tried a combination of the font
> size, the line height and the top field margin.
> But there are exceptions that don't return accurate values...
>
> Thank you in advance.
> Best,
> jbv
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
I might be misunderstanding what you are trying to do but you can get
the formattedRect of chunks in the field:
on mouseMove
if the mouseChunk is not empty then
put the formattedRect of the mouseChunk into field "Rect"
end if
end mouseMove
So you could take the middle point of the rect as the x,y location?
Warmest Regards,
Mark.
--
Mark Waddingham ~ mark at livecode.com ~ http://www.livecode.com/
LiveCode: Build Amazing Things
More information about the use-livecode
mailing list