Skip to content

Commit

Permalink
Add clarification of coordinates for Rectangle fields (#166)
Browse files Browse the repository at this point in the history
I spent almost a day trying to figure out why my texture map is so strange because I assumed that fields store coordinates in opposite order because of wording `top-left` and `bottom-right`.
  • Loading branch information
AngelicosPhosphoros committed Jul 16, 2023
1 parent 78cec67 commit 6ccbb7c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions draw-cache/src/geometry.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use core::ops;

/// A rectangle, with top-left corner at min, and bottom-right corner at max.
/// Both field are in `[offset from left, offset from top]` format.
#[derive(Copy, Clone, Debug, Default, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct Rectangle<N> {
pub min: [N; 2],
Expand Down

0 comments on commit 6ccbb7c

Please sign in to comment.