Skip to content

Commit 873be17

Browse files
Adding CENTER_CENTER pivot; documenting usage and effective behavior of rotation angle
1 parent 678f412 commit 873be17

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

egui_plot/src/items/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,9 @@ impl Text {
678678
self
679679
}
680680

681-
/// Text rotation angle.
681+
/// Sets the text rotation angle. Angles are defined in radians, with positive values
682+
/// resulting in a clockwise direction. Rotations are performed about the center of the
683+
/// bounding box.
682684
#[inline]
683685
pub fn angle(mut self, angle: f32) -> Self {
684686
self.angle = angle;
@@ -715,7 +717,7 @@ impl PlotItem for Text {
715717

716718
shapes.push(
717719
TextShape::new(rect.min, galley, color)
718-
.with_angle(self.angle)
720+
.with_angle_and_anchor(self.angle, Align2::CENTER_CENTER)
719721
.into(),
720722
);
721723

0 commit comments

Comments
 (0)