1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//! A terse, no-std crate for 2D integer geometry.
//!
//! ## Coordinate system
//!
//! All types in this crate use a _y-down_ coordinate system, where the origin `(0, 0)` is at the
//! top-left and `y` increases downward:
//!
//! ```txt
//! +---------→ x
//! |
//! |
//! ↓
//! y
//! ```
//!
//! This is the natural convention for screens, terminals, images, and most 2D game grids, and
//! matches the row-major ordering used by [`Pos`]'s [`Ord`] implementation and by the [`layout`]
//! module's default traversal order.
//!
//! ## Related crates
//!
//! This crate deliberately stays allocation-free and does not provide an owning grid type. For a
//! `Vec`-backed grid built on top of [`layout`]'s traversal and indexing abstractions, see the
//! sibling crate [`grixy`](https://docs.rs/grixy).
//!
//! ## Examples
//!
//! ```rust
//! use ixy::{Pos, Rect};
//!
//! let pos = Pos::new(10, 20);
//! let rect = Rect::from_ltwh(0, 0, 100, 200);
//!
//! assert_eq!(pos.x, 10);
//! assert_eq!(pos.y, 20);
//! assert_eq!(rect.left(), 0);
//! assert_eq!(rect.top(), 0);
//! assert_eq!(rect.width(), 100);
//! assert_eq!(rect.height(), 200);
//! assert_eq!(rect.right(), 100);
//! assert_eq!(rect.bottom(), 200);
//! assert!(rect.contains_pos(pos));
//! assert!(!rect.contains_pos(Pos::new(150, 250)));
//! ```
pub
pub use *;
pub use *;
pub use *;