From bf3947dcc5047cfaadd2363b18c4e2525e44eeb7 Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Sat, 10 Jan 2015 12:31:26 -0500 Subject: [PATCH] [OpenSim] Draw property lines on minimap properly for variable size regions This fixes Issue 1684: Minimap on Opensim Var Region showing bad the property lines This changeset is welcome for use under LGPL. --- indra/newview/llnetmap.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index 89c8e3b3a..d09aa2839 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -1155,17 +1155,18 @@ void LLNetMap::renderPropertyLinesForRegion(const LLViewerRegion* pRegion, const // // Draw the north and east region borders // - const S32 borderY = originY + llround(REGION_WIDTH_METERS * mObjectMapTPM); + const F32 real_width(pRegion->getWidth()); + const S32 borderY = originY + llround(real_width * mObjectMapTPM); if ( (borderY >= 0) && (borderY < imgHeight) ) { - S32 curX = llclamp(originX, 0, imgWidth), endX = llclamp(originX + llround(REGION_WIDTH_METERS * mObjectMapTPM), 0, imgWidth - 1); + S32 curX = llclamp(originX, 0, imgWidth), endX = llclamp(originX + llround(real_width * mObjectMapTPM), 0, imgWidth - 1); for (; curX <= endX; curX++) pTextureData[borderY * imgWidth + curX] = clrOverlay.mAll; } - const S32 borderX = originX + llround(REGION_WIDTH_METERS * mObjectMapTPM); + const S32 borderX = originX + llround(real_width * mObjectMapTPM); if ( (borderX >= 0) && (borderX < imgWidth) ) { - S32 curY = llclamp(originY, 0, imgHeight), endY = llclamp(originY + llround(REGION_WIDTH_METERS * mObjectMapTPM), 0, imgHeight - 1); + S32 curY = llclamp(originY, 0, imgHeight), endY = llclamp(originY + llround(real_width * mObjectMapTPM), 0, imgHeight - 1); for (; curY <= endY; curY++) pTextureData[curY * imgWidth + borderX] = clrOverlay.mAll; } @@ -1174,7 +1175,7 @@ void LLNetMap::renderPropertyLinesForRegion(const LLViewerRegion* pRegion, const // Render parcel lines // static const F32 GRID_STEP = PARCEL_GRID_STEP_METERS; - static const S32 GRIDS_PER_EDGE = REGION_WIDTH_METERS / GRID_STEP; + static const S32 GRIDS_PER_EDGE = real_width / GRID_STEP; const U8* pOwnership = pRegion->getParcelOverlay()->getOwnership(); const U8* pCollision = (pRegion->getHandle() == LLViewerParcelMgr::instance().getCollisionRegionHandle()) ? LLViewerParcelMgr::instance().getCollisionBitmap() : NULL;