feat(canvas): 배경 투명도 조절 및 시네마틱 번역 추가

- AsciiCanvasPainter/Widget에 backgroundOpacity 파라미터 추가
- 기본값 0.5 (50% 투명도)로 배경 렌더링
- CinematicView 텍스트에 l10n 번역 적용
This commit is contained in:
JiWoong Sul
2025-12-26 01:49:43 +09:00
parent ccdef6a409
commit 76d6bdc859
3 changed files with 13 additions and 4 deletions

View File

@@ -43,6 +43,7 @@ class AsciiCanvasPainter extends CustomPainter {
this.gridWidth = 60,
this.gridHeight = 8,
this.backgroundColor = AsciiColors.background,
this.backgroundOpacity = 0.5,
this.layerVersion = 0,
});
@@ -58,6 +59,9 @@ class AsciiCanvasPainter extends CustomPainter {
/// 배경색
final Color backgroundColor;
/// 배경 투명도 (0.0 ~ 1.0, 기본값 0.5 = 50%)
final double backgroundOpacity;
/// 레이어 버전 (변경 감지용)
final int layerVersion;
@@ -83,10 +87,10 @@ class AsciiCanvasPainter extends CustomPainter {
_lastFontSize = fontSize;
}
// 2. 배경 채우기
// 2. 배경 채우기 (투명도 적용)
canvas.drawRect(
Rect.fromLTWH(0, 0, size.width, size.height),
Paint()..color = backgroundColor,
Paint()..color = backgroundColor.withValues(alpha: backgroundOpacity),
);
// 3. 레이어별 렌더링 (z-order 순)

View File

@@ -13,6 +13,7 @@ class AsciiCanvasWidget extends StatelessWidget {
required this.layers,
this.gridWidth = 60,
this.gridHeight = 8,
this.backgroundOpacity = 0.5,
this.isAnimating = true,
this.layerVersion = 0,
});
@@ -26,6 +27,9 @@ class AsciiCanvasWidget extends StatelessWidget {
/// 그리드 높이 (행 수)
final int gridHeight;
/// 배경 투명도 (0.0 ~ 1.0, 기본값 0.5 = 50%)
final double backgroundOpacity;
/// 애니메이션 활성 상태 (willChange 최적화용)
final bool isAnimating;
@@ -40,6 +44,7 @@ class AsciiCanvasWidget extends StatelessWidget {
layers: layers,
gridWidth: gridWidth,
gridHeight: gridHeight,
backgroundOpacity: backgroundOpacity,
layerVersion: layerVersion,
),
size: Size.infinite,