From 0d6321571e316febea4bbdebf263326ce0257976 Mon Sep 17 00:00:00 2001 From: "kipp%netscape.com" Date: Thu, 22 Apr 1999 03:40:38 +0000 Subject: [PATCH] Fixed rendering bug with drawing poly areas during debug drawing --- layout/generic/nsImageMap.cpp | 34 +++++------------------------ layout/html/base/src/nsImageMap.cpp | 34 +++++------------------------ 2 files changed, 12 insertions(+), 56 deletions(-) diff --git a/layout/generic/nsImageMap.cpp b/layout/generic/nsImageMap.cpp index 9473b8fd582..1df830bf1c9 100644 --- a/layout/generic/nsImageMap.cpp +++ b/layout/generic/nsImageMap.cpp @@ -571,14 +571,17 @@ void PolyArea::Draw(nsIPresContext& aCX, nsIRenderingContext& aRC) aCX.GetPixelsToTwips(&p2t); nscoord x0 = NSIntPixelsToTwips(mCoords[0], p2t); nscoord y0 = NSIntPixelsToTwips(mCoords[1], p2t); + nscoord x1, y1; for (PRInt32 i = 2; i < mNumCoords; i += 2) { - nscoord x1 = NSIntPixelsToTwips(mCoords[i], p2t); - nscoord y1 = NSIntPixelsToTwips(mCoords[i+1], p2t); + x1 = NSIntPixelsToTwips(mCoords[i], p2t); + y1 = NSIntPixelsToTwips(mCoords[i+1], p2t); aRC.DrawLine(x0, y0, x1, y1); x0 = x1; y0 = y1; } - aRC.DrawLine(x0, y0, mCoords[0], mCoords[1]); + x1 = NSIntPixelsToTwips(mCoords[0], p2t); + y1 = NSIntPixelsToTwips(mCoords[1], p2t); + aRC.DrawLine(x0, y0, x1, y1); } } @@ -878,31 +881,6 @@ nsImageMap::Draw(nsIPresContext& aCX, nsIRenderingContext& aRC) } } -#if 0 -NS_IMETHODIMP -nsImageMap::SizeOf(nsISizeOfHandler* aHandler) const -{ - aHandler->Add(sizeof(*this)); - - aHandler->Add((size_t) (- ((PRInt32) sizeof(mName)))); - mName.SizeOf(aHandler); - - if (!aHandler->HaveSeen(mTag)) { - mTag->SizeOf(aHandler); - } - - aHandler->Add((size_t) (- ((PRInt32) sizeof(mAreas)))); - mAreas.SizeOf(aHandler); - - PRInt32 i, n = mAreas.Count(); - for (i = 0; i < n; i++) { - Area* area = (Area*) mAreas[i]; - area->SizeOf(aHandler); - } - return NS_OK; -} -#endif - NS_IMETHODIMP nsImageMap::BeginUpdate(nsIDocument *aDocument) { diff --git a/layout/html/base/src/nsImageMap.cpp b/layout/html/base/src/nsImageMap.cpp index 9473b8fd582..1df830bf1c9 100644 --- a/layout/html/base/src/nsImageMap.cpp +++ b/layout/html/base/src/nsImageMap.cpp @@ -571,14 +571,17 @@ void PolyArea::Draw(nsIPresContext& aCX, nsIRenderingContext& aRC) aCX.GetPixelsToTwips(&p2t); nscoord x0 = NSIntPixelsToTwips(mCoords[0], p2t); nscoord y0 = NSIntPixelsToTwips(mCoords[1], p2t); + nscoord x1, y1; for (PRInt32 i = 2; i < mNumCoords; i += 2) { - nscoord x1 = NSIntPixelsToTwips(mCoords[i], p2t); - nscoord y1 = NSIntPixelsToTwips(mCoords[i+1], p2t); + x1 = NSIntPixelsToTwips(mCoords[i], p2t); + y1 = NSIntPixelsToTwips(mCoords[i+1], p2t); aRC.DrawLine(x0, y0, x1, y1); x0 = x1; y0 = y1; } - aRC.DrawLine(x0, y0, mCoords[0], mCoords[1]); + x1 = NSIntPixelsToTwips(mCoords[0], p2t); + y1 = NSIntPixelsToTwips(mCoords[1], p2t); + aRC.DrawLine(x0, y0, x1, y1); } } @@ -878,31 +881,6 @@ nsImageMap::Draw(nsIPresContext& aCX, nsIRenderingContext& aRC) } } -#if 0 -NS_IMETHODIMP -nsImageMap::SizeOf(nsISizeOfHandler* aHandler) const -{ - aHandler->Add(sizeof(*this)); - - aHandler->Add((size_t) (- ((PRInt32) sizeof(mName)))); - mName.SizeOf(aHandler); - - if (!aHandler->HaveSeen(mTag)) { - mTag->SizeOf(aHandler); - } - - aHandler->Add((size_t) (- ((PRInt32) sizeof(mAreas)))); - mAreas.SizeOf(aHandler); - - PRInt32 i, n = mAreas.Count(); - for (i = 0; i < n; i++) { - Area* area = (Area*) mAreas[i]; - area->SizeOf(aHandler); - } - return NS_OK; -} -#endif - NS_IMETHODIMP nsImageMap::BeginUpdate(nsIDocument *aDocument) {