We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6bd3004 commit d59b1b9Copy full SHA for d59b1b9
plotters-backend/src/text.rs
@@ -135,6 +135,8 @@ pub enum FontTransform {
135
Rotate180,
136
/// Rotating the text 270 degree clockwise
137
Rotate270,
138
+ /// Rotating the text to an arbitrary degree clockwise
139
+ RotateAngle(f32),
140
}
141
142
impl FontTransform {
@@ -149,6 +151,10 @@ impl FontTransform {
149
151
FontTransform::Rotate90 => (-y, x),
150
152
FontTransform::Rotate180 => (-x, -y),
153
FontTransform::Rotate270 => (y, -x),
154
+ FontTransform::RotateAngle(angle) => (
155
+ ((x as f32) * angle.cos()).round() as i32,
156
+ ((y as f32) * angle.sin()).round() as i32,
157
+ ),
158
159
160
0 commit comments