On Apr 22, 12:55 am, Boris Zbarsky <[EMAIL PROTECTED]> wrote:
> Jonathan wrote:
> > The absolute position in the page.
>
> Get the presshell's root frame (via GetRootFrame()) and call GetOffsetTo()?
>
> -Boris

Thank you for your help.
I tried your suggestion, in the Paint() of nsImageFrame, i add this
code:

  nsIFrame* rootFrame = aPresContext->PresShell()->GetRootFrame();

          if (rootFrame) {
            nsPoint point = this->GetOffsetTo(rootFrame);
            printf (" offset %f %f\n", point.x, point.y);
         }

But i get "0.0, and 0.0" .

And when I use the DOM inspection in Firefox. It said "In the
Javascript Object" tab:
offsetLeft is 8 and offsetTop is 30.

And visually, I exect (8, 30 ) are the right values.

Can you please tell me what am i missing?

Thank you.
_______________________________________________
dev-tech-layout mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-layout

Reply via email to