FifeGUI 0.3.0
A C++ GUI library designed for games.
cliprectangle.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause
2// SPDX-FileCopyrightText: 2004 - 2008 Olof Naessén and Per Larsson
3// SPDX-FileCopyrightText: 2013 - 2026 Fifengine contributors
4
5// Corresponding header include
6#include "fifechan/cliprectangle.hpp"
7
8// Platform config include
9#include "fifechan/platform.hpp"
10
11// Project headers (subdirs before local)
12#include <cassert>
13
14#include "fifechan/rectangle.hpp"
15
16namespace fcn
17{
18 ClipRectangle::ClipRectangle(int x, int y, int width, int height, int xOffset, int yOffset) :
20 {
21 assert("Width must be non-negative" && width >= 0);
22 assert("Height must be non-negative" && height >= 0);
23 }
24
25 ClipRectangle& ClipRectangle::operator=(Rectangle const & other)
26 {
27 assert("Rectangle width must be non-negative" && other.width >= 0);
28 assert("Rectangle height must be non-negative" && other.height >= 0);
29
30 x = other.x;
31 y = other.y;
32 width = other.width;
33 height = other.height;
34
35 return *this;
36 }
37} // namespace fcn
int xOffset
Holds the x offset of the x coordinate.
ClipRectangle & operator=(Rectangle const &other)
Copy constructor.
int yOffset
Holds the y offset of the y coordinate.
Rectangle()
Constructor.
Definition rectangle.cpp:14
int width
Holds the width of the rectangle.
int y
Holds the x coordinate of the rectangle.
int x
Holds the x coordinate of the rectangle.
int height
Holds the height of the rectangle.
Used replacement tokens by configure_file():