Create ScreenLine struct

This commit is contained in:
Tulio Leao 2020-06-30 09:26:42 -03:00
parent 70e245a1c3
commit 5ce65eb7dc
1 changed files with 15 additions and 1 deletions

View File

@ -666,7 +666,7 @@ struct MapRange : public CoordsRange<CoordsXY>
assert(std::abs(GetLeft() - GetRight()) > 0);
assert(std::abs(GetTop() - GetBottom()) > 0);
}
MapRange Normalise() const
{
auto result = MapRange(
@ -675,3 +675,17 @@ struct MapRange : public CoordsRange<CoordsXY>
return result;
}
};
/**
* Represents a line on the screen
*/
struct ScreenLine : public CoordsRange<ScreenCoordsXY>
{
ScreenLine(const ScreenCoordsXY& leftTop, const ScreenCoordsXY& rightBottom)
: CoordsRange<ScreenCoordsXY>(leftTop, rightBottom)
{
// Make sure one of the point coords change
assert((std::abs(GetLeft() - GetRight()) > 0) || (std::abs(GetTop() - GetBottom()) > 0));
}
};