#pragma region CPL License /* Nuclex Native Framework Copyright (C) 2002-2013 Nuclex Development Labs This library is free software; you can redistribute it and/or modify it under the terms of the IBM Common Public License as published by the IBM Corporation; either version 1.0 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the IBM Common Public License for more details. You should have received a copy of the IBM Common Public License along with this library */ #pragma endregion // CPL License #ifndef NUCLEX_GRAPHICS_SIZE_H #define NUCLEX_GRAPHICS_SIZE_H #include namespace Nuclex { namespace Graphics { // ------------------------------------------------------------------------------------------- // /// Stores the dimensions of a 2D area class Size { /// Initializes a new size public: Size() : Width(0), Height(0) {} /// Initializes a new size with the specified dimensions /// Width the size will be initialized with /// Height the size will be initialized with public: Size(std::size_t width, std::size_t height) : Width(width), Height(height) {} /// Determines if the area is not covering any space /// True if the area is empty public: bool IsEmpty() const { return (this->Width == 0) || (this->Height == 0); } /// Resets the rectangle to empty public: void Reset() { this->Width = 0; this->Height = 0; } /// X coordinate of the rectangle's right border public: std::size_t Width; /// Y coordinate of the rectangle's bottom border public: std::size_t Height; }; // ------------------------------------------------------------------------------------------- // }} // namespace Nuclex::Graphics #endif // NUCLEX_GRAPHICS_SIZE_H