On Apr 22, 9:46 am, Boris Zbarsky <[EMAIL PROTECTED]> wrote:
> Jonathan wrote:
> > nsPoint point = this->GetOffsetTo(rootFrame);
> > printf (" offset %f %f\n", point.x, point.y);
>
> Of course point.x and point.y aren't floats, so you've got the whole "pass
> type
> 'x' to printf, and tell it to treat the memory as type 'y'" thing going. Does
> using %d instead help?
>
> -Boris
Thank you. I tried your suggestion:
printf ("nsImageFrame::Paint\n");
nsIFrame* rootFrame = aPresContext->PresShell()-
>GetRootFrame();
if (rootFrame) {
nsPoint point = this->GetOffsetTo(rootFrame);
printf ("t After offset %f %f\n", point.x, point.y);
printf ("t After offset %d %d\n", point.x, point.y);
}
//...
}
But the number still does not match up. I get:
nsImageFrame::Paint
t After offset 0.000000 0.000000
t After offset 120 330
But 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 expect (8, 30 ) are the right values.
Can you please tell me what am I missing?
Thank you again!
_______________________________________________
dev-tech-layout mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-layout