mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 06:11:37 +00:00
bug 314350, implement GetScrolledSize in nsScrollBoxObject
r/sr=bzbarsky
This commit is contained in:
parent
52230a880c
commit
9d82e45dd4
@ -318,7 +318,17 @@ NS_IMETHODIMP nsScrollBoxObject::GetPosition(PRInt32 *x, PRInt32 *y)
|
||||
/* void getScrolledSize (out long width, out long height); */
|
||||
NS_IMETHODIMP nsScrollBoxObject::GetScrolledSize(PRInt32 *width, PRInt32 *height)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
nsIFrame* scrolledBox = GetScrolledBox(this);
|
||||
if (!scrolledBox)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsRect scrollRect = scrolledBox->GetRect();
|
||||
float twipsToPixels = mPresShell->GetPresContext()->TwipsToPixels();
|
||||
|
||||
*width = NSTwipsToIntPixels(scrollRect.width, twipsToPixels);
|
||||
*height = NSTwipsToIntPixels(scrollRect.height, twipsToPixels);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* void ensureElementIsVisible (in nsIDOMElement child); */
|
||||
|
Loading…
Reference in New Issue
Block a user