Skip to content

Commit

Permalink
Fixed issues with ring rendering on mini and world map when ui scale …
Browse files Browse the repository at this point in the history
…was not exactly 1.0
  • Loading branch information
Shyotl committed Feb 5, 2018
1 parent 733fca3 commit 9b75abd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 20 deletions.
20 changes: 5 additions & 15 deletions indra/newview/llnetmap.cpp
Expand Up @@ -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");
Expand Down Expand Up @@ -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

// <FS:CR> Aurora Sim
mPixelsPerMeter = mScale / REGION_WIDTH_METERS;
// </FS:CR> Aurora Sim
pos_local.mV[VX] *= mPixelsPerMeter;
pos_local.mV[VY] *= mPixelsPerMeter;
// leave Z component in meters
Expand All @@ -786,17 +781,12 @@ LLVector3 LLNetMap::globalPosToView(const LLVector3d& global_pos)

void LLNetMap::drawRing(const F32 radius, const LLVector3 pos_map, const LLColor4& color)
{
// <FS:CR> Aurora Sim
F32 meters_to_pixels = mScale / LLWorld::getInstance()->getRegionWidthInMeters();
//F32 meters_to_pixels = mScale / REGION_WIDTH_METERS;
// </FS:CR> 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,
Expand Down
8 changes: 3 additions & 5 deletions indra/newview/llworldmapview.cpp
Expand Up @@ -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
Expand Down

0 comments on commit 9b75abd

Please sign in to comment.