зеркало из https://github.com/mozilla/gecko-dev.git
bug#13718: natural img dimens. pnunn, r:sfraser
This commit is contained in:
Родитель
8ebb9efe55
Коммит
e0a81cdaee
|
@ -179,13 +179,17 @@ nsFrameImageLoader::Init(nsIPresContext* aPresContext,
|
|||
|
||||
// Start image load request
|
||||
char* cp = aURL.ToNewCString();
|
||||
|
||||
|
||||
mImageRequest = aGroup->GetImage(cp, this, aBackgroundColor,
|
||||
desiredWidth, desiredHeight, 0);
|
||||
|
||||
nsCRT::free(cp);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsFrameImageLoader::AddFrame(nsIFrame* aFrame,
|
||||
nsIFrameImageLoaderCB aCallBack,
|
||||
|
@ -403,7 +407,6 @@ nsFrameImageLoader::GetIntrinsicSize(nsSize& aResult)
|
|||
PRUint32 width, height;
|
||||
float p2t;
|
||||
|
||||
mImageRequest->GetNaturalDimensions(&width, &height);
|
||||
mPresContext->GetScaledPixelsToTwips(&p2t);
|
||||
aResult.width = NSIntPixelsToTwips(width, p2t);
|
||||
aResult.height = NSIntPixelsToTwips(height, p2t);
|
||||
|
@ -413,6 +416,20 @@ nsFrameImageLoader::GetIntrinsicSize(nsSize& aResult)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsFrameImageLoader::GetNaturalImageSize(PRUint32* naturalWidth,
|
||||
PRUint32 *naturalHeight)
|
||||
{
|
||||
if(mImage){
|
||||
*naturalWidth = mImage->GetNaturalWidth();
|
||||
*naturalHeight = mImage->GetNaturalHeight();
|
||||
}else{
|
||||
*naturalWidth = 0;
|
||||
*naturalHeight = 0;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
nsFrameImageLoader::Notify(nsIImageRequest *aImageRequest,
|
||||
nsIImage *aImage,
|
||||
|
|
Загрузка…
Ссылка в новой задаче