dear_imgui_rs/texture/
rect.rs1use crate::sys;
2
3#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
5pub struct TextureRect {
6 pub x: u16,
8 pub y: u16,
10 pub w: u16,
12 pub h: u16,
14}
15
16impl From<sys::ImTextureRect> for TextureRect {
17 fn from(rect: sys::ImTextureRect) -> Self {
18 Self {
19 x: rect.x,
20 y: rect.y,
21 w: rect.w,
22 h: rect.h,
23 }
24 }
25}
26
27impl From<TextureRect> for sys::ImTextureRect {
28 fn from(rect: TextureRect) -> Self {
29 Self {
30 x: rect.x,
31 y: rect.y,
32 w: rect.w,
33 h: rect.h,
34 }
35 }
36}