Skip to content

Commit a969f5a

Browse files
bellwether-softworksmichalsustr
authored andcommitted
Adding CENTER_CENTER pivot; documenting usage and effective behavior of rotation angle
1 parent 86fc776 commit a969f5a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

egui_plot/src/items/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,9 @@ impl Text {
751751
self
752752
}
753753

754-
/// Text rotation angle.
754+
/// Sets the text rotation angle. Angles are defined in radians, with positive values
755+
/// resulting in a clockwise direction. Rotations are performed about the center of the
756+
/// bounding box.
755757
#[inline]
756758
pub fn angle(mut self, angle: f32) -> Self {
757759
self.angle = angle;
@@ -788,7 +790,7 @@ impl PlotItem for Text {
788790

789791
shapes.push(
790792
TextShape::new(rect.min, galley, color)
791-
.with_angle(self.angle)
793+
.with_angle_and_anchor(self.angle, Align2::CENTER_CENTER)
792794
.into(),
793795
);
794796

0 commit comments

Comments
 (0)