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
Родитель 42e784064b
Коммит 7eb29eb768
1 изменённых файлов: 8 добавлений и 2 удалений

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

@ -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()); }