@@ -34,18 +34,34 @@ function clampVisibleDepth(depth: number) {
3434 return Math . min ( Math . max ( depth , 0 ) , THREAD_REPLY_MAX_VISIBLE_DEPTH ) ;
3535}
3636
37- export function getThreadReplyIndentRem ( depth : number ) {
38- const visibleDepth = clampVisibleDepth ( depth ) ;
37+ function getThreadReplyVisualDepth ( depth : number ) {
38+ return clampVisibleDepth ( Math . max ( 0 , depth - 1 ) ) ;
39+ }
40+
41+ function getThreadReplyIndentForVisibleDepthRem ( visibleDepth : number ) {
3942 return visibleDepth > 0
4043 ? THREAD_REPLY_ROOT_INDENT_REM +
4144 ( visibleDepth - 1 ) * THREAD_REPLY_NESTED_INDENT_REM
4245 : 0 ;
4346}
4447
48+ export function getThreadReplyIndentRem ( depth : number ) {
49+ return getThreadReplyIndentForVisibleDepthRem (
50+ getThreadReplyVisualDepth ( depth ) ,
51+ ) ;
52+ }
53+
4554export function getThreadReplyAvatarCenterRem ( depth : number ) {
4655 return getThreadReplyIndentRem ( depth ) + THREAD_REPLY_AVATAR_CENTER_OFFSET_REM ;
4756}
4857
58+ function getThreadReplyAvatarCenterForVisibleDepthRem ( visibleDepth : number ) {
59+ return (
60+ getThreadReplyIndentForVisibleDepthRem ( visibleDepth ) +
61+ THREAD_REPLY_AVATAR_CENTER_OFFSET_REM
62+ ) ;
63+ }
64+
4965export function getThreadReplyAvatarCenterYRem ( ) {
5066 return THREAD_REPLY_AVATAR_CENTER_Y_REM ;
5167}
@@ -59,13 +75,16 @@ export function getThreadReplyDescendantRailStartYRem() {
5975}
6076
6177export function getThreadReplyConnectorLayout ( depth : number ) {
62- const visibleDepth = clampVisibleDepth ( depth ) ;
78+ const visibleDepth = getThreadReplyVisualDepth ( depth ) ;
6379 if ( visibleDepth === 0 ) {
6480 return null ;
6581 }
6682
67- const parentOffsetRem = getThreadReplyAvatarCenterRem ( visibleDepth - 1 ) ;
68- const childOffsetRem = getThreadReplyAvatarCenterRem ( visibleDepth ) ;
83+ const parentOffsetRem = getThreadReplyAvatarCenterForVisibleDepthRem (
84+ visibleDepth - 1 ,
85+ ) ;
86+ const childOffsetRem =
87+ getThreadReplyAvatarCenterForVisibleDepthRem ( visibleDepth ) ;
6988 const childEdgeOffsetRem =
7089 childOffsetRem -
7190 THREAD_REPLY_AVATAR_RADIUS_REM -
0 commit comments