From b64dd9a32ca5aa32abb27c158dd2ff5864b8e7f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20M=C3=A9taireau?= Date: Thu, 3 Apr 2025 21:26:34 +0200 Subject: [PATCH] Use the proper spacing, adding a margin when that's needed. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Dimensions given by Flo: > Largeur: 1.6cm > Boucle: 7.2cm > Partie imprimable: 14.6cm > Longueur hors boucle + partie imprimée = 22cm --- main.rs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/main.rs b/main.rs index 65609c5..9309bd4 100644 --- a/main.rs +++ b/main.rs @@ -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 = Rgba([0, 0, 0, 255]); const COLOR_BACKGROUND: Rgba = Rgba([255, 255, 255, 255]);