Use the proper spacing, adding a margin when that's needed.

Dimensions given by Flo:

> Largeur: 1.6cm
> Boucle: 7.2cm
> Partie imprimable: 14.6cm
> Longueur hors boucle + partie imprimée = 22cm
This commit is contained in:
Alexis Métaireau 2025-04-03 21:26:34 +02:00
parent c6aff4e2d7
commit b64dd9a32c
No known key found for this signature in database
GPG key ID: 1C21B876828E5FF2

17
main.rs
View file

@ -11,27 +11,28 @@ use std::path::{Path, PathBuf};
// Configuration for the label
const DPI: f32 = 300.0;
const MM_TO_PX: f32 = DPI / 25.4;
const LABEL_WIDTH: f32 = 210.0 * MM_TO_PX;
const LABEL_HEIGHT: f32 = 20.0 * MM_TO_PX;
const LABEL_WIDTH: f32 = 220.0 * MM_TO_PX;
const LABEL_HEIGHT: f32 = 16.0 * MM_TO_PX;
// Elements positionning
const MARGIN_LEFT: f32 = 72.0 * MM_TO_PX;
const LOGO_WIDTH: u32 = 151;
const LOGO_HEIGHT: u32 = 64;
const LOGO_POS_X: u32 = LABEL_WIDTH as u32 - LOGO_WIDTH - 10;
const LOGO_POS_Y: u32 = 10;
const CLIENT_CODE_POS_X: i32 = 10;
const CLIENT_CODE_POS_X: i32 = MARGIN_LEFT as i32 + 10;
const CLIENT_CODE_POS_Y: i32 = 10;
const CLIENT_CODE_SCALE: f32 = 24.0;
const DATE_POS_X: i32 = 10;
const DATE_POS_Y: i32 = 40;
const DATE_SCALE: f32 = 32.0;
const SPECIES_VARIETY_POS_X: i32 = 10;
const SPECIES_VARIETY_POS_X: i32 = MARGIN_LEFT as i32 + 10;
const SPECIES_VARIETY_POS_Y: i32 = 80;
const SPECIES_VARIETY_SCALE: f32 = 24.0;
const DATE_POS_X: i32 = MARGIN_LEFT as i32 + 10;
const DATE_POS_Y: i32 = 40;
const DATE_SCALE: f32 = 32.0;
const COLOR_TEXT: Rgba<u8> = Rgba([0, 0, 0, 255]);
const COLOR_BACKGROUND: Rgba<u8> = Rgba([255, 255, 255, 255]);