label: Rename IdTextConfig to TextConfig

It is not specific to IDs.
This commit is contained in:
Simon Bruder 2024-07-12 20:26:28 +02:00
parent ebbc5c0c19
commit 1a9f0f2e7d
Signed by: simon
GPG key ID: 347FF8699CDA0776
2 changed files with 10 additions and 10 deletions

View file

@ -58,8 +58,8 @@ pub struct LabelConfig {
height: Mm,
data_matrix: Option<DataMatrixConfig>,
code128: Option<Code128Config>,
id_text: Option<IdTextConfig>,
short_id_text: Option<IdTextConfig>,
id_text: Option<TextConfig>,
short_id_text: Option<TextConfig>,
}
#[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<S: Into<String>>(
&self,
layer: &PdfLayerReference,

View file

@ -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<LabelConfig> 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<LabelConfig> 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<LabelConfig> 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)),
}),