Add nsPresContext::AppUnitsToGfxUnits(const nsRect&)

b=430450 r+sr=roc
This commit is contained in:
Karl Tomlinson 2008-07-07 14:28:24 +12:00
parent d2915d5735
commit 3fc8bd0f47

View File

@ -62,8 +62,8 @@
#include "nsInterfaceHashtable.h"
#include "nsCycleCollectionParticipant.h"
#include "nsChangeHint.h"
// XXX we need only gfxTypes.h, but we cannot include it directly.
#include "gfxPoint.h"
// This also pulls in gfxTypes.h, which we cannot include directly.
#include "gfxRect.h"
class nsImageLoader;
#ifdef IBMBIDI
class nsBidiPresUtils;
@ -520,6 +520,12 @@ public:
gfxFloat AppUnitsToGfxUnits(nscoord aAppUnits) const
{ return mDeviceContext->AppUnitsToGfxUnits(aAppUnits); }
gfxRect AppUnitsToGfxUnits(const nsRect& aAppRect) const
{ return gfxRect(AppUnitsToGfxUnits(aAppRect.x),
AppUnitsToGfxUnits(aAppRect.y),
AppUnitsToGfxUnits(aAppRect.width),
AppUnitsToGfxUnits(aAppRect.height)); }
nscoord TwipsToAppUnits(PRInt32 aTwips) const
{ return NSToCoordRound(NS_TWIPS_TO_INCHES(aTwips) *
mDeviceContext->AppUnitsPerInch()); }