@@ -60,9 +60,10 @@ impl<'a> From<&'a str> for FontFamily<'a> {
60
60
/// ```
61
61
pub mod text_anchor {
62
62
/// The horizontal position of the anchor point relative to the text.
63
- #[ derive( Clone , Copy ) ]
63
+ #[ derive( Clone , Copy , Default ) ]
64
64
pub enum HPos {
65
65
/// Anchor point is on the left side of the text
66
+ #[ default]
66
67
Left ,
67
68
/// Anchor point is on the right side of the text
68
69
Right ,
@@ -71,9 +72,10 @@ pub mod text_anchor {
71
72
}
72
73
73
74
/// The vertical position of the anchor point relative to the text.
74
- #[ derive( Clone , Copy ) ]
75
+ #[ derive( Clone , Copy , Default ) ]
75
76
pub enum VPos {
76
77
/// Anchor point is on the top of the text
78
+ #[ default]
77
79
Top ,
78
80
/// Anchor point is in the vertical center of the text
79
81
Center ,
@@ -82,7 +84,7 @@ pub mod text_anchor {
82
84
}
83
85
84
86
/// The text anchor position.
85
- #[ derive( Clone , Copy ) ]
87
+ #[ derive( Clone , Copy , Default ) ]
86
88
pub struct Pos {
87
89
/// The horizontal position of the anchor point
88
90
pub h_pos : HPos ,
@@ -106,21 +108,6 @@ pub mod text_anchor {
106
108
Pos { h_pos, v_pos }
107
109
}
108
110
109
- /// Create a default text anchor position (top left).
110
- ///
111
- /// - **returns** The default text anchor position
112
- ///
113
- /// ```rust
114
- /// use plotters_backend::text_anchor::{Pos, HPos, VPos};
115
- ///
116
- /// let pos = Pos::default();
117
- /// ```
118
- pub fn default ( ) -> Self {
119
- Pos {
120
- h_pos : HPos :: Left ,
121
- v_pos : VPos :: Top ,
122
- }
123
- }
124
111
}
125
112
}
126
113
0 commit comments