@@ -870,8 +870,8 @@ class MatSlider {
870
870
}
871
871
_updateTickMarkUINonRange ( step ) {
872
872
const value = this . _getValue ( ) ;
873
- let numActive = Math . max ( Math . floor ( ( value - this . min ) / step ) , 0 ) ;
874
- let numInactive = Math . max ( Math . floor ( ( this . max - value ) / step ) , 0 ) ;
873
+ let numActive = Math . max ( Math . round ( ( value - this . min ) / step ) , 0 ) ;
874
+ let numInactive = Math . max ( Math . round ( ( this . max - value ) / step ) , 0 ) ;
875
875
this . _isRtl ? numActive ++ : numInactive ++ ;
876
876
this . _tickMarks = Array ( numActive )
877
877
. fill ( _MatTickMark . ACTIVE )
@@ -880,9 +880,9 @@ class MatSlider {
880
880
_updateTickMarkUIRange ( step ) {
881
881
const endValue = this . _getValue ( ) ;
882
882
const startValue = this . _getValue ( _MatThumb . START ) ;
883
- const numInactiveBeforeStartThumb = Math . max ( Math . floor ( ( startValue - this . min ) / step ) , 0 ) ;
884
- const numActive = Math . max ( Math . floor ( ( endValue - startValue ) / step ) + 1 , 0 ) ;
885
- const numInactiveAfterEndThumb = Math . max ( Math . floor ( ( this . max - endValue ) / step ) , 0 ) ;
883
+ const numInactiveBeforeStartThumb = Math . max ( Math . round ( ( startValue - this . min ) / step ) , 0 ) ;
884
+ const numActive = Math . max ( Math . round ( ( endValue - startValue ) / step ) + 1 , 0 ) ;
885
+ const numInactiveAfterEndThumb = Math . max ( Math . round ( ( this . max - endValue ) / step ) , 0 ) ;
886
886
this . _tickMarks = Array ( numInactiveBeforeStartThumb )
887
887
. fill ( _MatTickMark . INACTIVE )
888
888
. concat ( Array ( numActive ) . fill ( _MatTickMark . ACTIVE ) , Array ( numInactiveAfterEndThumb ) . fill ( _MatTickMark . INACTIVE ) ) ;
0 commit comments