summaryrefslogtreecommitdiff
path: root/indra/newview/llworldmapview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llworldmapview.cpp')
-rw-r--r--indra/newview/llworldmapview.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp
index d80cd317c3..9ac758433c 100644
--- a/indra/newview/llworldmapview.cpp
+++ b/indra/newview/llworldmapview.cpp
@@ -177,8 +177,10 @@ LLWorldMapView::LLWorldMapView()
{
sPixelsPerMeter = gMapScale / REGION_WIDTH_METERS;
clearLastClick();
+}
- LLUICtrlFactory::getInstance()->buildPanel(this, "panel_worldmap.xml");
+BOOL LLWorldMapView::postBuild()
+{
mTextBoxNorth = getChild<LLTextBox> ("floater_map_north");
mTextBoxEast = getChild<LLTextBox> ("floater_map_east");
mTextBoxWest = getChild<LLTextBox> ("floater_map_west");
@@ -205,6 +207,8 @@ LLWorldMapView::LLWorldMapView()
mTextBoxNorthEast ->reshapeToFitText();
mTextBoxSouthWest->reshapeToFitText();
mTextBoxNorthWest ->reshapeToFitText();
+
+ return true;
}
@@ -294,8 +298,8 @@ void LLWorldMapView::draw()
const S32 width = getRect().getWidth();
const S32 height = getRect().getHeight();
- const S32 half_width = width / 2;
- const S32 half_height = height / 2;
+ const F32 half_width = F32(width) / 2.0f;
+ const F32 half_height = F32(height) / 2.0f;
LLVector3d camera_global = gAgent.getCameraPositionGlobal();
LLLocalClipRect clip(getLocalRect());
@@ -339,8 +343,8 @@ void LLWorldMapView::draw()
// Find x and y position relative to camera's center.
LLVector3d rel_region_pos = origin_global - camera_global;
- S32 relative_x = lltrunc((rel_region_pos.mdV[0] / REGION_WIDTH_METERS) * gMapScale);
- S32 relative_y = lltrunc((rel_region_pos.mdV[1] / REGION_WIDTH_METERS) * gMapScale);
+ F32 relative_x = (rel_region_pos.mdV[0] / REGION_WIDTH_METERS) * gMapScale;
+ F32 relative_y = (rel_region_pos.mdV[1] / REGION_WIDTH_METERS) * gMapScale;
F32 pix_width = gMapScale*(layer->LayerExtents.getWidth() + 1);
F32 pix_height = gMapScale*(layer->LayerExtents.getHeight() + 1);
@@ -445,8 +449,8 @@ void LLWorldMapView::draw()
// Find x and y position relative to camera's center.
LLVector3d rel_region_pos = origin_global - camera_global;
- S32 relative_x = lltrunc((rel_region_pos.mdV[0] / REGION_WIDTH_METERS) * gMapScale);
- S32 relative_y = lltrunc((rel_region_pos.mdV[1] / REGION_WIDTH_METERS) * gMapScale);
+ F32 relative_x = (rel_region_pos.mdV[0] / REGION_WIDTH_METERS) * gMapScale;
+ F32 relative_y = (rel_region_pos.mdV[1] / REGION_WIDTH_METERS) * gMapScale;
// When the view isn't panned, 0,0 = center of rectangle
F32 bottom = sPanY + half_height + relative_y;