Files
petitspas/frontend/lib/models/card_assets.dart
T
jmartinandCursor ebf77b1ebb fix(#173): 9-slice dynamique sur les bulles (centerSlice)
Coins fixes, bords et centre extensibles selon la taille réelle
de la bulle — sans assets .9.png Android.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-01 17:10:40 +02:00

38 lines
1.2 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import 'package:flutter/material.dart';
enum CardColorVertical {
red('assets/cards/card_red.png'),
pink('assets/cards/card_pink.png'),
peach('assets/cards/card_peach.png'),
lime('assets/cards/card_lime.png'),
lavender('assets/cards/card_lavender.png'),
green('assets/cards/card_green.png'),
blue('assets/cards/card_blue.png');
final String path;
const CardColorVertical(this.path);
}
enum CardColorHorizontal {
red('assets/cards/card_red_h.png'),
pink('assets/cards/card_pink_h.png'),
peach('assets/cards/card_peach_h.png'),
lime('assets/cards/card_lime_h.png'),
lavender('assets/cards/card_lavender_h.png'),
green('assets/cards/card_green_h.png'),
blue('assets/cards/card_blue_h.png');
final String path;
const CardColorHorizontal(this.path);
/// Taille intrinsèque des PNG `card_*_h` (~1024×512).
static const Size sourceSize = Size(1024, 512);
/// Facteur d’affichage : PNG ~2× → coins 9-slice en taille logique correcte.
static const double displayScale = 2.0;
/// 9-slice en pixels image : coins fixes, bords H/V + centre extensibles.
/// Même logique que extensible.png — sans fichier `.9.png` Android.
static const Rect centerSlice = Rect.fromLTRB(100, 90, 924, 422);
}