AeonGUI
A portable video game graphic user interface library.
Loading...
Searching...
No Matches
DOMRect.hpp
1/*
2Copyright (C) 2025,2026 Rodrigo Jose Hernandez Cordoba
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
16#ifndef AEONGUI_DOMRECT_HPP
17#define AEONGUI_DOMRECT_HPP
18
19#include "aeongui/Platform.hpp"
20#include "aeongui/dom/DOMRectReadOnly.hpp"
21
22namespace AeonGUI
23{
24 namespace DOM
25 {
31 class DLL DOMRect : public DOMRectReadOnly
32 {
33 public:
40 DOMRect ( float x = 0.0f, float y = 0.0f, float width = 0.0f, float height = 0.0f );
42 virtual ~DOMRect() final;
43
44 using DOMRectReadOnly::x;
45 using DOMRectReadOnly::y;
48 using DOMRectReadOnly::top;
51 using DOMRectReadOnly::left;
52
54 float x ( float newX );
56 float y ( float newY );
58 float width ( float newWidth );
60 float height ( float newHeight );
62 float top ( float newTop );
64 float right ( float newRight );
66 float bottom ( float newBottom );
68 float left ( float newLeft );
69
75 template <typename T>
76 static DOMRect fromRect ( const T& rect )
77 {
78 return DOMRect ( rect.x(), rect.y(), rect.width(), rect.height() );
79 }
80 };
81 }
82}
83
84#endif
Platform-specific DLL import/export macros and compiler helpers.
float x(float newX)
Set the X coordinate.
Definition DOMRect.cpp:28
static DOMRect fromRect(const T &rect)
Create a DOMRect from any rect-like object.
Definition DOMRect.hpp:76
float height(float newHeight)
Set the height.
Definition DOMRect.cpp:46
DOMRect(float x=0.0f, float y=0.0f, float width=0.0f, float height=0.0f)
Construct a rectangle.
Definition DOMRect.cpp:22
float y(float newY)
Set the Y coordinate.
Definition DOMRect.cpp:34
float top(float newTop)
Set the top edge.
Definition DOMRect.cpp:52
virtual ~DOMRect() final
Destructor.
float left(float newLeft)
Set the left edge.
Definition DOMRect.cpp:70
float right(float newRight)
Set the right edge.
Definition DOMRect.cpp:58
float bottom(float newBottom)
Set the bottom edge.
Definition DOMRect.cpp:64
float width(float newWidth)
Set the width.
Definition DOMRect.cpp:40
DOMRectReadOnly(float x=0.0f, float y=0.0f, float width=0.0f, float height=0.0f)
Construct a rectangle.
Definition DOMRectReadOnly.cpp:23