From 3fc8bd0f470091903a9e5aec65c8df595852648a Mon Sep 17 00:00:00 2001 From: Karl Tomlinson Date: Mon, 7 Jul 2008 14:28:24 +1200 Subject: [PATCH] Add nsPresContext::AppUnitsToGfxUnits(const nsRect&) b=430450 r+sr=roc --- layout/base/nsPresContext.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/layout/base/nsPresContext.h b/layout/base/nsPresContext.h index 7c626df7368..ea1ca3d811d 100644 --- a/layout/base/nsPresContext.h +++ b/layout/base/nsPresContext.h @@ -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()); }