fix: 긴 댓글 카드가 출처를 덮던 문제 — 캡처 5줄 말줄임 + 드래프트 축소 안전망
카드 캡처는 댓글 길이만큼 세로로 자라는데 배치 높이 한계(영상 아래~출처 사이 약 640px)가 어디에도 없어 장문 댓글이 출처(@채널)와 화면을 덮었다. 1차: 카드 본문을 최대 5줄 말줄임(검토 화면 = 캡처 결과라 WYSIWYG). 2차: 그래도 표시 높이가 한계를 넘는 카드는 draft 배치에서 비율 축소. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
2266d0a3ee
commit
9b2cc96e3e
@ -113,6 +113,10 @@ BG_CAPTION_Y = _ty(1030) # 영상 하단부 자막 ≈ -0.07
|
|||||||
BG_CHANNEL_Y = _ty(1850) # 맨 아래 출처 ≈ -0.93 (하단 댓글영역 아래)
|
BG_CHANNEL_Y = _ty(1850) # 맨 아래 출처 ≈ -0.93 (하단 댓글영역 아래)
|
||||||
|
|
||||||
COMMENT_SCALE = 0.89 # 댓글 카드 확대(캡컷 인스펙터 89%)
|
COMMENT_SCALE = 0.89 # 댓글 카드 확대(캡컷 인스펙터 89%)
|
||||||
|
# 카드 아랫변이 넘으면 안 되는 y(px) — 출처(@채널, 파이프라인 기준 y≈1800) 위 여유까지.
|
||||||
|
# 캡처 쪽 5줄 말줄임이 1차 방어지만, 예외적으로 큰 카드(줄바꿈 연타 등)가 와도
|
||||||
|
# 여기서 비율 축소해 출처를 절대 덮지 않는다(안전망).
|
||||||
|
COMMENT_MAX_BOTTOM = 1760
|
||||||
|
|
||||||
|
|
||||||
# 하단 검은 배경 자막 글꼴 크기 — 고정값(캡컷 폰트 크기와 1:1).
|
# 하단 검은 배경 자막 글꼴 크기 — 고정값(캡컷 폰트 크기와 1:1).
|
||||||
@ -313,15 +317,20 @@ def build_bg_template_draft(
|
|||||||
dur = _us(te) - _us(ts)
|
dur = _us(te) - _us(ts)
|
||||||
if dur <= 0 or not img or not os.path.isfile(img):
|
if dur <= 0 or not img or not os.path.isfile(img):
|
||||||
continue
|
continue
|
||||||
|
eff = COMMENT_SCALE
|
||||||
if comment_top is not None:
|
if comment_top is not None:
|
||||||
iw, ih = _img_wh(img)
|
iw, ih = _img_wh(img)
|
||||||
disp_h = cw * (ih / iw) * COMMENT_SCALE
|
disp_h = cw * (ih / iw) * eff
|
||||||
|
max_h = COMMENT_MAX_BOTTOM - comment_top
|
||||||
|
if 0 < max_h < disp_h: # 긴 카드 — 출처를 덮기 전에 그 카드만 축소
|
||||||
|
eff *= max_h / disp_h
|
||||||
|
disp_h = max_h
|
||||||
cy = _ty(comment_top + disp_h / 2, ch)
|
cy = _ty(comment_top + disp_h / 2, ch)
|
||||||
else:
|
else:
|
||||||
cy = comment_y if comment_y is not None else round(-1162/1920, 4)
|
cy = comment_y if comment_y is not None else round(-1162/1920, 4)
|
||||||
script.add_segment(p.VideoSegment(
|
script.add_segment(p.VideoSegment(
|
||||||
p.VideoMaterial(img), p.Timerange(_us(ts), dur),
|
p.VideoMaterial(img), p.Timerange(_us(ts), dur),
|
||||||
clip_settings=p.ClipSettings(scale_x=COMMENT_SCALE, scale_y=COMMENT_SCALE,
|
clip_settings=p.ClipSettings(scale_x=eff, scale_y=eff,
|
||||||
transform_x=0.0, transform_y=cy),
|
transform_x=0.0, transform_y=cy),
|
||||||
), "comment")
|
), "comment")
|
||||||
|
|
||||||
|
|||||||
@ -157,7 +157,11 @@
|
|||||||
.cc-meta{flex:1;min-width:0;}
|
.cc-meta{flex:1;min-width:0;}
|
||||||
.cc-author{font-weight:600;font-size:13.5px;color:#fff;}
|
.cc-author{font-weight:600;font-size:13.5px;color:#fff;}
|
||||||
.cc-time{font-size:11.5px;color:#aaa;margin-left:6.4px;}
|
.cc-time{font-size:11.5px;color:#aaa;margin-left:6.4px;}
|
||||||
.cc-text{font-size:14px;color:#fff;margin-top:5.6px;white-space:pre-wrap;word-break:break-word;line-height:1.5;}
|
/* 본문 최대 5줄 말줄임(…) — 카드는 캡처돼 드래프트 하단(영상 아래~출처 사이 약 640px)에
|
||||||
|
들어가는데, 긴 댓글은 세로가 무한정 자라 출처(@채널)를 덮는다. 5줄이면 표시 높이가
|
||||||
|
그 한계 안이고, 검토 화면 = 캡처 결과(WYSIWYG)라 여기서 자르는 게 맞다. */
|
||||||
|
.cc-text{font-size:14px;color:#fff;margin-top:5.6px;white-space:pre-wrap;word-break:break-word;line-height:1.5;
|
||||||
|
display:-webkit-box;-webkit-line-clamp:5;-webkit-box-orient:vertical;overflow:hidden;}
|
||||||
.cc-stats{font-size:12px;color:#aaa;margin-top:8px;display:flex;gap:16px;font-variant-numeric:tabular-nums;}
|
.cc-stats{font-size:12px;color:#aaa;margin-top:8px;display:flex;gap:16px;font-variant-numeric:tabular-nums;}
|
||||||
.comment-card.mosaic .cc-avatar{filter:blur(6px);}
|
.comment-card.mosaic .cc-avatar{filter:blur(6px);}
|
||||||
.comment-card.mosaic .cc-author{filter:blur(5px);}
|
.comment-card.mosaic .cc-author{filter:blur(5px);}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user