From 1a9f0f2e7dd14ea39bfcf11541a803d4d5cc58b6 Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Fri, 12 Jul 2024 20:26:28 +0200 Subject: [PATCH] label: Rename IdTextConfig to TextConfig It is not specific to IDs. --- src/label/mod.rs | 8 ++++---- src/label/preset.rs | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/label/mod.rs b/src/label/mod.rs index 9de85c4..34f2db1 100644 --- a/src/label/mod.rs +++ b/src/label/mod.rs @@ -58,8 +58,8 @@ pub struct LabelConfig { height: Mm, data_matrix: Option, code128: Option, - id_text: Option, - short_id_text: Option, + id_text: Option, + short_id_text: Option, } #[derive(Debug)] @@ -120,12 +120,12 @@ impl Code128Config { } #[derive(Debug)] -pub struct IdTextConfig { +pub struct TextConfig { font_size: f32, position: (Mm, Mm), } -impl IdTextConfig { +impl TextConfig { fn draw>( &self, layer: &PdfLayerReference, diff --git a/src/label/preset.rs b/src/label/preset.rs index 46a219d..abb2d45 100644 --- a/src/label/preset.rs +++ b/src/label/preset.rs @@ -5,7 +5,7 @@ use printpdf::Mm; use serde::Deserialize; -use super::{Code128Config, DataMatrixConfig, IdTextConfig, LabelConfig}; +use super::{Code128Config, DataMatrixConfig, LabelConfig, TextConfig}; #[derive(Clone, Debug, Deserialize)] #[serde(rename_all = "kebab-case")] @@ -27,7 +27,7 @@ impl Into for LabelPreset { position: (Mm(0.0), Mm(0.0)), }), code128: None, - id_text: Some(IdTextConfig { + id_text: Some(TextConfig { font_size: 7.0, position: (Mm(0.0), Mm(22.0)), }), @@ -41,11 +41,11 @@ impl Into for LabelPreset { scale: (Mm(44.45), Mm(19.0)), position: (Mm(0.0), Mm(2.5)), }), - id_text: Some(IdTextConfig { + id_text: Some(TextConfig { font_size: 7.0, position: (Mm(0.0), Mm(22.0)), }), - short_id_text: Some(IdTextConfig { + short_id_text: Some(TextConfig { font_size: 7.0, position: (Mm(0.0), Mm(0.0)), }), @@ -61,11 +61,11 @@ impl Into for LabelPreset { scale: (Mm(27.45), Mm(16.0)), position: (Mm(17.0), Mm(4.0)), }), - id_text: Some(IdTextConfig { + id_text: Some(TextConfig { font_size: 7.0, position: (Mm(0.0), Mm(22.0)), }), - short_id_text: Some(IdTextConfig { + short_id_text: Some(TextConfig { font_size: 7.0, position: (Mm(17.0), Mm(0.0)), }),