Browse Source

Introduce Point::Absolute and Point::ManhattanDistance

pull/2113/head
Vladimir Olteanu 5 years ago committed by Anders Jenbo
parent
commit
ba3f0aef8b
  1. 12
      Source/engine.h

12
Source/engine.h

@ -190,6 +190,18 @@ struct Point {
return (approx + 512) / 1024;
}
Point Absolute() const
{
return { abs(x), abs(y) };
}
int ManhattanDistance(Point other) const
{
Point offset = (*this - other).Absolute();
return offset.x + offset.y;
}
};
struct Size {

Loading…
Cancel
Save