summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/llfloaterworldmap.cpp4
-rwxr-xr-xindra/newview/llworldmapview.cpp19
-rw-r--r--indra/newview/llworldmapview.h3
3 files changed, 19 insertions, 7 deletions
diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp
index e7b1efb41d..6bb0ed73e4 100755
--- a/indra/newview/llfloaterworldmap.cpp
+++ b/indra/newview/llfloaterworldmap.cpp
@@ -1333,9 +1333,9 @@ void LLFloaterWorldMap::centerOnTarget(BOOL animate)
}
F64 map_scale = (F64)mMapView->getScale();
- mMapView->setPan(-llfloor((F32)(pos_global.mdV[VX] * map_scale / REGION_WIDTH_METERS)),
+ mMapView->setPanWithInterpTime(-llfloor((F32)(pos_global.mdV[VX] * map_scale / REGION_WIDTH_METERS)),
-llfloor((F32)(pos_global.mdV[VY] * map_scale / REGION_WIDTH_METERS)),
- !animate);
+ !animate, 0.1f);
mWaitingForTracker = FALSE;
}
diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp
index 2ac4b30d2e..6e994b4e68 100755
--- a/indra/newview/llworldmapview.cpp
+++ b/indra/newview/llworldmapview.cpp
@@ -185,7 +185,8 @@ LLWorldMapView::LLWorldMapView() :
mMouseDownY(0),
mSelectIDStart(0),
mMapScale(0.f),
- mTargetMapScale(0.f)
+ mTargetMapScale(0.f),
+ mMapIterpTime(MAP_ITERP_TIME_CONSTANT)
{
// LL_INFOS("WorldMap") << "Creating the Map -> LLWorldMapView::LLWorldMapView()" << LL_ENDL;
@@ -283,7 +284,7 @@ void LLWorldMapView::setScale(F32 scale, bool snap)
{
mMapScale = 0.1f;
}
-
+ mMapIterpTime = MAP_ITERP_TIME_CONSTANT;
F32 ratio = (scale / old_scale);
mPanX *= ratio;
mPanY *= ratio;
@@ -325,6 +326,7 @@ void LLWorldMapView::translatePan(S32 delta_x, S32 delta_y)
// static
void LLWorldMapView::setPan(S32 x, S32 y, BOOL snap)
{
+ mMapIterpTime = MAP_ITERP_TIME_CONSTANT;
mTargetPanX = (F32) x;
mTargetPanY = (F32) y;
if (snap)
@@ -335,6 +337,13 @@ void LLWorldMapView::setPan(S32 x, S32 y, BOOL snap)
sVisibleTilesLoaded = false;
}
+// static
+void LLWorldMapView::setPanWithInterpTime(S32 x, S32 y, BOOL snap, F32 interp_time)
+{
+ setPan(x, y, snap);
+ mMapIterpTime = interp_time;
+}
+
bool LLWorldMapView::showRegionInfo() { return (LLWorldMipmap::scaleToLevel(mMapScale) <= DRAW_SIMINFO_THRESHOLD ? true : false); }
///////////////////////////////////////////////////////////////////////////////////
@@ -357,9 +366,9 @@ void LLWorldMapView::draw()
mVisibleRegions.clear();
- // animate pan if necessary
- mPanX = lerp(mPanX, mTargetPanX, LLSmoothInterpolation::getInterpolant(MAP_ITERP_TIME_CONSTANT));
- mPanY = lerp(mPanY, mTargetPanY, LLSmoothInterpolation::getInterpolant(MAP_ITERP_TIME_CONSTANT));
+ // animate pan if necessary
+ mPanX = lerp(mPanX, mTargetPanX, LLSmoothInterpolation::getInterpolant(mMapIterpTime));
+ mPanY = lerp(mPanY, mTargetPanY, LLSmoothInterpolation::getInterpolant(mMapIterpTime));
//RN: snaps to zoom value because interpolation caused jitter in the text rendering
if (!sZoomTimer.getStarted() && mMapScale != mTargetMapScale)
diff --git a/indra/newview/llworldmapview.h b/indra/newview/llworldmapview.h
index edbdded120..ce8af76a82 100644
--- a/indra/newview/llworldmapview.h
+++ b/indra/newview/llworldmapview.h
@@ -80,6 +80,7 @@ public:
// Pan is in pixels relative to the center of the map.
void translatePan( S32 delta_x, S32 delta_y );
void setPan( S32 x, S32 y, BOOL snap = TRUE );
+ void setPanWithInterpTime(S32 x, S32 y, BOOL snap, F32 interp_time);
// Return true if the current scale level is above the threshold for accessing region info
bool showRegionInfo();
@@ -212,6 +213,8 @@ private:
static F32 sMapScaleSetting;
static LLVector2 sZoomPivot;
static LLFrameTimer sZoomTimer;
+
+ F32 mMapIterpTime;
};
#endif