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

View File

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

View File

@@ -128,9 +128,9 @@ class _CinematicViewState extends State<CinematicView>
_AsciiArtDisplay(asciiArt: step.asciiArt!), _AsciiArtDisplay(asciiArt: step.asciiArt!),
const SizedBox(height: 24), const SizedBox(height: 24),
], ],
// 텍스트 // 텍스트 (l10n 적용)
Text( Text(
step.text, l10n.translateCinematic(step.text),
style: const TextStyle( style: const TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 18, fontSize: 18,