@@ -241,7 +241,7 @@ protected override void OnDisable()
241241 m_VerticalScrollbar . onValueChanged . RemoveListener ( SetVerticalNormalizedPosition ) ;
242242
243243 m_HasRebuiltLayout = false ;
244- m_Tracker . Clear ( true ) ;
244+ m_Tracker . Clear ( ) ;
245245 m_Velocity = Vector2 . zero ;
246246 LayoutRebuilder . MarkLayoutForRebuild ( rectTransform ) ;
247247 base . OnDisable ( ) ;
@@ -379,7 +379,6 @@ protected virtual void LateUpdate()
379379 return ;
380380
381381 EnsureLayoutHasRebuilt ( ) ;
382- UpdateScrollbarVisibility ( ) ;
383382 UpdateBounds ( ) ;
384383 float deltaTime = Time . unscaledDeltaTime ;
385384 Vector2 offset = CalculateOffset ( Vector2 . zero ) ;
@@ -412,16 +411,13 @@ protected virtual void LateUpdate()
412411 }
413412 }
414413
415- if ( m_Velocity != Vector2 . zero )
414+ if ( m_MovementType == MovementType . Clamped )
416415 {
417- if ( m_MovementType == MovementType . Clamped )
418- {
419- offset = CalculateOffset ( position - m_Content . anchoredPosition ) ;
420- position += offset ;
421- }
422-
423- SetContentAnchoredPosition ( position ) ;
416+ offset = CalculateOffset ( position - m_Content . anchoredPosition ) ;
417+ position += offset ;
424418 }
419+
420+ SetContentAnchoredPosition ( position ) ;
425421 }
426422
427423 if ( m_Dragging && m_Inertia )
@@ -437,6 +433,7 @@ protected virtual void LateUpdate()
437433 m_OnValueChanged . Invoke ( normalizedPosition ) ;
438434 UpdatePrevData ( ) ;
439435 }
436+ UpdateScrollbarVisibility ( ) ;
440437 }
441438
442439 protected void UpdatePrevData ( )
@@ -584,7 +581,7 @@ public virtual void CalculateLayoutInputVertical() {}
584581
585582 public virtual void SetLayoutHorizontal ( )
586583 {
587- m_Tracker . Clear ( true ) ;
584+ m_Tracker . Clear ( ) ;
588585
589586 if ( m_HSliderExpand || m_VSliderExpand )
590587 {
0 commit comments