SL-17785 FIXED World Map scrolls too slowly when searching for a region.

meow-7.2.2
Mnikolenko Productengine 2022-07-18 16:53:43 +03:00
parent 23534c4f1c
commit 38cc06e43a
3 changed files with 19 additions and 7 deletions

View File

@ -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;
}

View File

@ -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)

View File

@ -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