mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2026-08-07 14:16:56 +02:00
don't use std::iter::Step on Coord
This commit is contained in:
parent
49dcb4f3ba
commit
33e135c614
2 changed files with 3 additions and 3 deletions
|
|
@ -22,7 +22,7 @@ pub trait Coord: Send + Sync + Copy
|
||||||
+ From<u16> + Into<u16>
|
+ From<u16> + Into<u16>
|
||||||
+ Into<usize>
|
+ Into<usize>
|
||||||
+ Into<f64>
|
+ Into<f64>
|
||||||
+ std::iter::Step
|
//+ std::iter::Step
|
||||||
{
|
{
|
||||||
/// Zero in own type.
|
/// Zero in own type.
|
||||||
fn zero () -> Self { 0.into() }
|
fn zero () -> Self { 0.into() }
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ pub trait Lrtb<N: Coord>: Xywh<N> {
|
||||||
// FIXME: factor origin
|
// FIXME: factor origin
|
||||||
[self.x(), self.y(), self.x()+self.w(), self.y()+self.h()]
|
[self.x(), self.y(), self.x()+self.w(), self.y()+self.h()]
|
||||||
}
|
}
|
||||||
fn iter_x (&self) -> impl Iterator<Item = N> where Self: HasOrigin {
|
fn iter_x (&self) -> std::ops::Range<N> where Self: HasOrigin {
|
||||||
self.x_west()..self.x_east()
|
self.x_west()..self.x_east()
|
||||||
}
|
}
|
||||||
fn x_west (&self) -> N where Self: HasOrigin {
|
fn x_west (&self) -> N where Self: HasOrigin {
|
||||||
|
|
@ -26,7 +26,7 @@ pub trait Lrtb<N: Coord>: Xywh<N> {
|
||||||
fn x_center (&self) -> N where Self: HasOrigin {
|
fn x_center (&self) -> N where Self: HasOrigin {
|
||||||
todo!()
|
todo!()
|
||||||
}
|
}
|
||||||
fn iter_y (&self) -> impl Iterator<Item = N> where Self: HasOrigin {
|
fn iter_y (&self) -> std::ops::Range<N> where Self: HasOrigin {
|
||||||
self.y_north()..self.y_south()
|
self.y_north()..self.y_south()
|
||||||
}
|
}
|
||||||
fn y_north (&self) -> N where Self: HasOrigin {
|
fn y_north (&self) -> N where Self: HasOrigin {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue