bug#13718: natural img dimens. pnunn, r:sfraser

This commit is contained in:
pnunn%netscape.com 2000-09-08 22:47:46 +00:00
Родитель 8ebb9efe55
Коммит e0a81cdaee
1 изменённых файлов: 18 добавлений и 1 удалений

Просмотреть файл

@ -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,