Scroll container
This commit is contained in:
parent
1f4be3fdd3
commit
2026024949
2 changed files with 63 additions and 6 deletions
20
utils.odin
20
utils.odin
|
|
@ -91,6 +91,26 @@ enum_to_raygui_options_string :: proc($T: typeid, allocator: mem.Allocator) -> c
|
|||
|
||||
|
||||
/// ### RECTANGLES ### ///
|
||||
rect2_to_irect2 :: proc "contextless" (rect: rect2) -> irect2 {
|
||||
return {i32(rect.x), i32(rect.y), i32(rect.width), i32(rect.height)}
|
||||
}
|
||||
|
||||
irect2_to_rect2 :: proc "contextless" (rect: irect2) -> rect2 {
|
||||
return {f32(rect.x), f32(rect.y), f32(rect.width), f32(rect.height)}
|
||||
}
|
||||
|
||||
|
||||
rect_has_point :: proc {rect2_has_point, irect2_has_point}
|
||||
|
||||
@(private="file") rect2_has_point :: proc "contextless" (rect: rect2, p: v2) -> bool {
|
||||
return p.x >= rect.x && p.x < rect.x + rect.width && p.y >= rect.y && p.y < rect.y + rect.height
|
||||
}
|
||||
|
||||
@(private="file") irect2_has_point :: proc "contextless" (rect: irect2, p: iv2) -> bool {
|
||||
return p.x >= rect.x && p.x < rect.x + rect.width && p.y >= rect.y && p.y < rect.y + rect.height
|
||||
}
|
||||
|
||||
|
||||
rect_translate :: proc {rect2_translate, irect2_translate}
|
||||
|
||||
@(private="file") rect2_translate :: proc "contextless" (rect: rect2, translation: v2) -> rect2 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue