point and refPoint

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

point and refPoint

Rajat Gogri
Hello All,

When I debug and see mouse event Structure there are 2 parameters.

1) point
2) refPoint

point is place where mouse was clicked. those coordinates I am able to
understand. can anyone tell me what is refPoint???

OR anyone can explain what rare ref and refPoint for my better
understanding.

Thanks and Regards,
Raj
_______________________________________________
dev-tech-layout mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-layout
Reply | Threaded
Open this post in threaded view
|

Re: point and refPoint

Eli Friedman
Rajat Gogri wrote:
> Hello All,
>
> When I debug and see mouse event Structure there are 2 parameters.

I'm not really sure why you're using a debugger; it's somewhat helpful
for debugging Mozilla code, but I can't imagine it being very useful for
your own code. (the DOM Inspector and Venkman are usually much better
for Javascript) I'm sure you have your reasons, though.

> 1) point
> 2) refPoint
>
> point is place where mouse was clicked. those coordinates I am able to
> understand. can anyone tell me what is refPoint???

refPoint is quite simple to understand: it's just coordinates of the
event relative to the widget which received the event, in device pixels.

point is actually a lot more complicated; its meaning varies depending
on where exactly you're talking about. Sometimes it's relative to the
current event frame, sometimes it's relative to the nearest view to the
current event frame, sometimes it's relative to the view the event got
dispatched against, sometimes it's relative to the widget the event got
dispatched against.  The relevant code is mostly in nsViewManager.cpp
and PresShell::HandleEvent.

Note that on the trunk the point member is gone because it was too
confusing to keep track of; the coordinates are computed from refPoint
when needed.
_______________________________________________
dev-tech-layout mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-layout
Reply | Threaded
Open this post in threaded view
|

Re: point and refPoint

Eli Friedman
In reply to this post by Rajat Gogri
Oh, and in the future, please don't cross-post questions like this (just
m.d.t.layout is sufficient.)
_______________________________________________
dev-tech-layout mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-layout