From 435925559701487529564c825b814422aca3cd58 Mon Sep 17 00:00:00 2001 From: AngelicosPhosphoros Date: Sun, 16 Jul 2023 18:28:19 +0400 Subject: [PATCH] Add clarification of coordinates for `Rectangle` fields 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`. --- draw-cache/src/geometry.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/draw-cache/src/geometry.rs b/draw-cache/src/geometry.rs index c485ce8..0b75639 100644 --- a/draw-cache/src/geometry.rs +++ b/draw-cache/src/geometry.rs @@ -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 { pub min: [N; 2],