Make Common::Point use non-negative dimensions, like the other classes in Rect.

This commit is contained in:
Stephen Anthony 2019-05-29 09:16:13 -02:30
parent bd2185e3f5
commit 1ea2c967ce
2 changed files with 6 additions and 4 deletions

View File

@ -174,7 +174,9 @@ void FrameBufferSDL2::updateWindowedPos()
if (!myCenter && myWindow && !(SDL_GetWindowFlags(myWindow) & SDL_WINDOW_FULLSCREEN_DESKTOP))
{
// save current windowed position
SDL_GetWindowPosition(myWindow, &myWindowedPos.x, &myWindowedPos.y);
Int32 x = 0, y = 0;
SDL_GetWindowPosition(myWindow, &x, &y);
myWindowedPos = Common::Point(x, y);
myOSystem.settings().setValue("windowedpos", myWindowedPos);
}
}

View File

@ -32,12 +32,12 @@ namespace Common {
*/
struct Point
{
Int32 x; //!< The horizontal part of the point
Int32 y; //!< The vertical part of the point
uInt32 x; //!< The horizontal part of the point
uInt32 y; //!< The vertical part of the point
Point() : x(0), y(0) { }
Point(const Point& p) : x(p.x), y(p.y) { }
explicit Point(Int32 x1, Int32 y1) : x(x1), y(y1) { }
explicit Point(uInt32 x1, uInt32 y1) : x(x1), y(y1) { }
explicit Point(const string& p) : x(0), y(0) {
char c = '\0';
istringstream buf(p);