doc auto cfg

This commit is contained in:
bendn 2023-10-28 07:32:34 +07:00
parent 59bf636236
commit 831f05de5b
No known key found for this signature in database
GPG key ID: 0D9D3A2A3B2A93D6
3 changed files with 6 additions and 2 deletions

View file

@ -48,3 +48,6 @@ debug = 2
opt-level = 3 opt-level = 3
lto = "thin" lto = "thin"
incremental = true incremental = true
[package.metadata.docs.rs]
all-features = true

View file

@ -10,7 +10,7 @@ impl<T: AsMut<[u8]> + AsRef<[u8]>> Image<T, 4> {
/// ``` /// ```
/// # use fimg::Image; /// # use fimg::Image;
/// let font = fontdue::Font::from_bytes( /// let font = fontdue::Font::from_bytes(
/// &include_bytes!("../../tdata/CascadiaCode.ttf")[..], /// &include_bytes!("../../tdata/CascadiaCode.ttf")[..],
/// fontdue::FontSettings { /// fontdue::FontSettings {
/// scale: 200.0, /// scale: 200.0,
/// ..Default::default() /// ..Default::default()
@ -18,7 +18,7 @@ impl<T: AsMut<[u8]> + AsRef<[u8]>> Image<T, 4> {
/// ).unwrap(); /// ).unwrap();
/// let mut i: Image<_, 4> = Image::alloc(750, 250).boxed(); /// let mut i: Image<_, 4> = Image::alloc(750, 250).boxed();
/// i.text(50, 10, 200.0, &font, "hello", [0, 0, 0, 255]); /// i.text(50, 10, 200.0, &font, "hello", [0, 0, 0, 255]);
/// assert_eq!(i.buffer(), include_bytes!("../../tdata/text.imgbuf")); /// # assert_eq!(i.buffer(), include_bytes!("../../tdata/text.imgbuf"));
/// ``` /// ```
pub fn text(&mut self, x: u32, y: u32, size: f32, font: &Font, text: &str, color: [u8; 4]) { pub fn text(&mut self, x: u32, y: u32, size: f32, font: &Font, text: &str, color: [u8; 4]) {
let mut lay = let mut lay =

View file

@ -9,6 +9,7 @@
slice_flatten, slice_flatten,
portable_simd, portable_simd,
array_windows, array_windows,
doc_auto_cfg,
const_option, const_option,
array_chunks array_chunks
)] )]