summaryrefslogtreecommitdiff
path: root/indra/newview/llnetmap.cpp
diff options
context:
space:
mode:
authorLogan Dethrow <log@lindenlab.com>2011-05-06 15:25:12 -0400
committerLogan Dethrow <log@lindenlab.com>2011-05-06 15:25:12 -0400
commit39ad3f1d880a26dcf8189cad2501002c189a7ac2 (patch)
treea843d0c5843ca5e6a5fcbdfc6929bc2b21b960d6 /indra/newview/llnetmap.cpp
parent5c7a906b44aa950ec3c8b786fec6516b51f9d66c (diff)
parentdef9f9290e661e6a35b7b255eb71b6e2767fdea0 (diff)
merge
Diffstat (limited to 'indra/newview/llnetmap.cpp')
-rw-r--r--indra/newview/llnetmap.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp
index 981b4dbee3..5fe5c9b1e8 100644
--- a/indra/newview/llnetmap.cpp
+++ b/indra/newview/llnetmap.cpp
@@ -330,8 +330,8 @@ void LLNetMap::draw()
//localMouse(&local_mouse_x, &local_mouse_y);
LLUI::getMousePositionLocal(this, &local_mouse_x, &local_mouse_y);
mClosestAgentToCursor.setNull();
- F32 closest_dist = F32_MAX;
- F32 min_pick_dist = mDotRadius * MIN_PICK_SCALE;
+ F32 closest_dist_squared = F32_MAX; // value will be overridden in the loop
+ F32 min_pick_dist_squared = (mDotRadius * MIN_PICK_SCALE) * (mDotRadius * MIN_PICK_SCALE);
// Draw avatars
for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin();
@@ -410,11 +410,11 @@ void LLNetMap::draw()
}
}
- F32 dist_to_cursor = dist_vec(LLVector2(pos_map.mV[VX], pos_map.mV[VY]),
+ F32 dist_to_cursor_squared = dist_vec_squared(LLVector2(pos_map.mV[VX], pos_map.mV[VY]),
LLVector2(local_mouse_x,local_mouse_y));
- if(dist_to_cursor < min_pick_dist && dist_to_cursor < closest_dist)
+ if(dist_to_cursor_squared < min_pick_dist_squared && dist_to_cursor_squared < closest_dist_squared)
{
- closest_dist = dist_to_cursor;
+ closest_dist_squared = dist_to_cursor_squared;
mClosestAgentToCursor = regionp->mMapAvatarIDs.get(i);
}
}
@@ -451,9 +451,9 @@ void LLNetMap::draw()
dot_width,
dot_width);
- F32 dist_to_cursor = dist_vec(LLVector2(pos_map.mV[VX], pos_map.mV[VY]),
+ F32 dist_to_cursor_squared = dist_vec_squared(LLVector2(pos_map.mV[VX], pos_map.mV[VY]),
LLVector2(local_mouse_x,local_mouse_y));
- if(dist_to_cursor < min_pick_dist && dist_to_cursor < closest_dist)
+ if(dist_to_cursor_squared < min_pick_dist_squared && dist_to_cursor_squared < closest_dist_squared)
{
mClosestAgentToCursor = gAgent.getID();
}