From 8776876e9302692df6c20fcaa38559d79f50b87f Mon Sep 17 00:00:00 2001 From: Shyotl Date: Sat, 18 Nov 2017 17:31:56 -0600 Subject: [PATCH] Fixed issues with ring rendering on mini and world map when ui scale was not exactly 1.0 --- indra/newview/llnetmap.cpp | 20 +++++--------------- indra/newview/llworldmapview.cpp | 8 +++----- 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index 23f5f9708..53463dea8 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -132,8 +132,6 @@ LLNetMap::LLNetMap(const std::string& name) : mClosestAgentToCursor(), mPopupMenu(NULL) { - mPixelsPerMeter = mScale / REGION_WIDTH_METERS; - mDotRadius = llmax(DOT_SCALE * mPixelsPerMeter, MIN_DOT_RADIUS); setScale(gSavedSettings.getF32("MiniMapScale")); LLUICtrlFactory::getInstance()->buildPanel(this, "panel_mini_map.xml"); @@ -763,9 +761,6 @@ LLVector3 LLNetMap::globalPosToView(const LLVector3d& global_pos) LLVector3 pos_local; pos_local.setVec(relative_pos_global); // convert to floats from doubles -// Aurora Sim - mPixelsPerMeter = mScale / REGION_WIDTH_METERS; -// Aurora Sim pos_local.mV[VX] *= mPixelsPerMeter; pos_local.mV[VY] *= mPixelsPerMeter; // leave Z component in meters @@ -786,17 +781,12 @@ LLVector3 LLNetMap::globalPosToView(const LLVector3d& global_pos) void LLNetMap::drawRing(const F32 radius, const LLVector3 pos_map, const LLColor4& color) { -// Aurora Sim - F32 meters_to_pixels = mScale / LLWorld::getInstance()->getRegionWidthInMeters(); - //F32 meters_to_pixels = mScale / REGION_WIDTH_METERS; -// Aurora Sim - F32 radius_pixels = radius * meters_to_pixels; + F32 radius_pixels = radius * mPixelsPerMeter; - gGL.matrixMode(LLRender::MM_MODELVIEW); - gGL.pushMatrix(); - gGL.translatef((F32)pos_map.mV[VX], (F32)pos_map.mV[VY], 0.f); - gl_ring(radius_pixels, WIDTH_PIXELS, color, color, CIRCLE_STEPS, FALSE); - gGL.popMatrix(); + gGL.pushUIMatrix(); + gGL.translateUI(pos_map.mV[VX], pos_map.mV[VY], 0.f); + gl_washer_2d(radius_pixels, radius_pixels-WIDTH_PIXELS, CIRCLE_STEPS, color, color); + gGL.popUIMatrix(); } void LLNetMap::drawTracking(const LLVector3d& pos_global, const LLColor4& color, diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp index 63ef8e245..8064b537b 100644 --- a/indra/newview/llworldmapview.cpp +++ b/indra/newview/llworldmapview.cpp @@ -1688,12 +1688,10 @@ void LLWorldMapView::drawTrackingCircle( const LLRect& rect, S32 x, S32 y, const end_theta -= angle_adjust_y; } - gGL.matrixMode(LLRender::MM_MODELVIEW); - gGL.pushMatrix(); - gGL.translatef((F32)x, (F32)y, 0.f); + gGL.pushUIMatrix(); + gGL.translateUI(x, y, 0.f); gl_washer_segment_2d(inner_radius, outer_radius, start_theta, end_theta, 40, color, color); - gGL.popMatrix(); - + gGL.popUIMatrix(); } // static