diff options
Diffstat (limited to 'indra/newview/llworldmapview.cpp')
-rwxr-xr-x | indra/newview/llworldmapview.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
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) |