Skip to content

Commit 0756740

Browse files
Add area documentation to Texture::load_from_image
1 parent 23e27d0 commit 0756740

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/graphics/texture.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,12 @@ impl Texture {
127127
/// Load texture from an image
128128
///
129129
/// # Arguments
130-
/// * image - Image to upload to the texture
130+
///
131+
/// - `image`: Image to upload to the texture
132+
/// - `area`: Can be used to load only a sub-rectangle of the whole image.
133+
/// If you want the entire image then use a default `IntRect`.
134+
/// If the area rectangle crosses the bounds of the image,
135+
/// it is adjusted to fit the image size.
131136
pub fn load_from_image(&mut self, image: &Image, area: IntRect) -> SfResult<()> {
132137
unsafe { ffi::sfTexture_loadFromImage(self, image.raw(), area).into_sf_result() }
133138
}

0 commit comments

Comments
 (0)