Dragging! & basic proportional box resize frm cursor distance to box pos

Still need to add resize via 'pulling' to stretch the box out from a side or 2 sides diagonally.

Also some general clenaup of code
This commit is contained in:
2024-03-08 03:34:21 -05:00
parent 90478bec94
commit 191d5076ea
15 changed files with 278 additions and 79 deletions

View File

@ -33,6 +33,19 @@ Range2 :: struct #raw_union{
},
}
range2 :: #force_inline proc "contextless" ( a, b : Vec2 ) -> Range2 {
result := Range2 { pts = { a, b } }
return result
}
Rect :: struct {
top_left, bottom_right : Vec2
}
add_range2 :: #force_inline proc "contextless" ( a, b : Range2 ) -> Range2 {
result := Range2 { pts = {
a.p0 + b.p0,
a.p1 + b.p1,
}}
return result
}