Skip to content

Commit

Permalink
Fix SectionText::scale docs
Browse files Browse the repository at this point in the history
  • Loading branch information
alexheretic committed Jun 8, 2023
1 parent 1c78963 commit 78cec67
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions glyph-brush/src/legacy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::{borrow::Cow, f32, hash::*};
pub struct SectionText<'a> {
/// Text to render
pub text: &'a str,
/// Position on screen to render text, in pixels from top-left. Defaults to (0, 0).
/// Pixel scale of text. Defaults to 16.
pub scale: PxScale,
/// Rgba color of rendered text. Defaults to black.
pub color: Color,
Expand Down Expand Up @@ -266,7 +266,7 @@ pub struct Section<'a> {
pub screen_position: (f32, f32),
/// Max (width, height) bounds, in pixels from top-left. Defaults to unbounded.
pub bounds: (f32, f32),
/// Font scale. Defaults to 16
/// Pixel scale of text. Defaults to 16.
pub scale: PxScale,
/// Rgba color of rendered text. Defaults to black.
pub color: [f32; 4],
Expand Down Expand Up @@ -460,7 +460,7 @@ impl<'a> From<&'a OwnedVariedSection> for Cow<'a, crate::Section<'a>> {
pub struct OwnedSectionText {
/// Text to render
pub text: String,
/// Position on screen to render text, in pixels from top-left. Defaults to (0, 0).
/// Pixel scale of text. Defaults to 16.
pub scale: PxScale,
/// Rgba color of rendered text. Defaults to black.
pub color: [f32; 4],
Expand Down
3 changes: 3 additions & 0 deletions layout/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Unreleased (0.2.4)
* Fix `SectionText::scale` docs.

# 0.2.3
* Default layouts: Keep word trailing space width if ending in a hard break or end of all glyphs _e.g. `"Foo \n"`_ _(This particularly changes the layout of right & centre aligned text ending in spaces)_.

Expand Down
2 changes: 1 addition & 1 deletion layout/src/section.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ impl Default for SectionGeometry {
pub struct SectionText<'a> {
/// Text to render
pub text: &'a str,
/// Position on screen to render text, in pixels from top-left. Defaults to (0, 0).
/// Pixel scale of text. Defaults to 16.
pub scale: PxScale,
/// Font id to use for this section.
///
Expand Down

0 comments on commit 78cec67

Please sign in to comment.