![]() |
Max OS 0.3
|
Stores the left, top, width and height of a rectangle. More...
#include <rectangle.h>
Public Member Functions | |
| Rectangle () | |
| _______________________________________________TEMPLATES_________________________________________________________________/// | |
| Rectangle (Type left, Type top, Type width, Type height) | |
| Creates a new rectangle, if width or height are negative, the left/top will be adjusted and the width/height made positive. | |
| bool | intersects (const Rectangle< Type > &) |
| Rectangle< Type > | intersection (const Rectangle< Type > &) |
| Vector< Rectangle< Type > > | subtract (const Rectangle< Type > &) |
| bool | contains (const Rectangle< Type > &) |
| bool | contains (Type x, Type y) |
Public Attributes | |
| Type | left { 0 } |
| The left coordinate of the rectangle. | |
| Type | top { 0 } |
| The top coordinate of the rectangle. | |
| Type | width { 0 } |
| The width of the rectangle. | |
| Type | height { 0 } |
| The height of the rectangle. | |
Stores the left, top, width and height of a rectangle.
| Type | The type of the rectangle (assumed to be numeric) |
Definition at line 22 of file rectangle.h.
Creates a new rectangle, if width or height are negative, the left/top will be adjusted and the width/height made positive.
| Type | The type of the rectangle |
| left | The left coordinate |
| top | The top coordinate |
| width | The width of the rectangle |
| height | The height of the rectangle |
Definition at line 56 of file rectangle.h.
References MaxOS::common::Rectangle< Type >::height, MaxOS::common::Rectangle< Type >::left, MaxOS::common::Rectangle< Type >::top, and MaxOS::common::Rectangle< Type >::width.
Checks if this rectangle contains another rectangle
| Type | The type of the rectangle |
| other | The other rectangle |
Definition at line 192 of file rectangle.h.
References MaxOS::common::Rectangle< Type >::height, MaxOS::common::Rectangle< Type >::left, MaxOS::common::Rectangle< Type >::top, and MaxOS::common::Rectangle< Type >::width.
Referenced by MaxOS::gui::Widget::contains_coordinate(), MaxOS::gui::CompositeWidget::on_mouse_enter_widget(), MaxOS::gui::CompositeWidget::on_mouse_leave_widget(), and MaxOS::gui::CompositeWidget::on_mouse_move_widget().
Checks if this rectangle contains a point
| Type | The type of the rectangle |
| x | The x coordinate of the point |
| y | The y coordinate of the point |
Definition at line 223 of file rectangle.h.
References MaxOS::common::Rectangle< Type >::height, MaxOS::common::Rectangle< Type >::left, MaxOS::common::Rectangle< Type >::top, and MaxOS::common::Rectangle< Type >::width.
Returns a retangle that represents the intersection of this rectangle and another rectangle
| Type | The type of the rectangle |
| other | The other rectangle |
Definition at line 116 of file rectangle.h.
References MaxOS::common::Rectangle< Type >::height, MaxOS::common::Rectangle< Type >::left, MaxOS::common::Rectangle< Type >::top, and MaxOS::common::Rectangle< Type >::width.
Referenced by MaxOS::gui::CompositeWidget::draw(), and MaxOS::gui::Window::draw_self().
Checks if the rectangle intersects with another rectangle
| Type | The type of the rectangle |
| other | The other rectangle |
Definition at line 88 of file rectangle.h.
References MaxOS::common::Rectangle< Type >::height, MaxOS::common::Rectangle< Type >::left, MaxOS::common::Rectangle< Type >::top, and MaxOS::common::Rectangle< Type >::width.
Referenced by MaxOS::gui::widgets::Button::draw(), MaxOS::gui::widgets::InputBox::draw(), MaxOS::gui::CompositeWidget::draw(), MaxOS::gui::Window::draw_self(), MaxOS::gui::Desktop::internal_invalidate(), and MaxOS::common::Rectangle< Type >::subtract().
| Vector< Rectangle< Type > > MaxOS::common::Rectangle< Type >::subtract | ( | const Rectangle< Type > & | other | ) |
Subtracts a rectangle from this rectangle
| Type | The type of the rectangle |
| other | The rectangle to subtract |
Definition at line 142 of file rectangle.h.
References MaxOS::common::Rectangle< Type >::height, MaxOS::common::Rectangle< Type >::intersects(), MaxOS::common::Rectangle< Type >::left, MaxOS::common::Rectangle< Type >::Rectangle(), MaxOS::common::Rectangle< Type >::top, and MaxOS::common::Rectangle< Type >::width.
Referenced by MaxOS::gui::CompositeWidget::draw(), MaxOS::gui::Desktop::internal_invalidate(), and MaxOS::gui::Widget::resize().
| Type MaxOS::common::Rectangle< Type >::height { 0 } |
The height of the rectangle.
Definition at line 27 of file rectangle.h.
Referenced by MaxOS::common::Rectangle< Type >::contains(), MaxOS::common::Rectangle< Type >::contains(), MaxOS::gui::Desktop::Desktop(), MaxOS::gui::widgets::Button::draw(), MaxOS::gui::widgets::InputBox::draw(), MaxOS::gui::widgets::Text::draw(), MaxOS::gui::Desktop::draw_self(), MaxOS::gui::Window::draw_self(), MaxOS::gui::Font::draw_text(), MaxOS::drivers::console::VESABootConsole::height(), MaxOS::common::Rectangle< Type >::intersection(), MaxOS::common::Rectangle< Type >::intersects(), MaxOS::gui::Widget::invalidate(), MaxOS::gui::Window::on_mouse_button_pressed(), MaxOS::gui::Desktop::on_mouse_move_event(), MaxOS::gui::WidgetMoverResizer< Left, Top, Width, Height >::on_mouse_move_event(), MaxOS::drivers::console::VESABootConsole::print_logo(), MaxOS::common::Rectangle< Type >::Rectangle(), MaxOS::gui::Widget::resize(), MaxOS::common::Rectangle< Type >::subtract(), and MaxOS::drivers::console::VESABootConsole::update_progress_bar().
| Type MaxOS::common::Rectangle< Type >::left { 0 } |
The left coordinate of the rectangle.
Definition at line 24 of file rectangle.h.
Referenced by MaxOS::gui::Widget::absolute_coordinates(), MaxOS::gui::Window::add_child(), MaxOS::common::Rectangle< Type >::contains(), MaxOS::common::Rectangle< Type >::contains(), MaxOS::gui::widgets::Button::draw(), MaxOS::gui::widgets::InputBox::draw(), MaxOS::gui::widgets::Text::draw(), MaxOS::gui::CompositeWidget::draw(), MaxOS::gui::Desktop::draw_self(), MaxOS::gui::Window::draw_self(), MaxOS::gui::Font::draw_text(), MaxOS::common::Rectangle< Type >::intersection(), MaxOS::common::Rectangle< Type >::intersects(), MaxOS::gui::Widget::move(), MaxOS::gui::CompositeWidget::on_mouse_button_pressed(), MaxOS::gui::CompositeWidget::on_mouse_button_released(), MaxOS::gui::CompositeWidget::on_mouse_enter_widget(), MaxOS::gui::CompositeWidget::on_mouse_leave_widget(), MaxOS::gui::WidgetMoverResizer< Left, Top, Width, Height >::on_mouse_move_event(), MaxOS::common::Rectangle< Type >::Rectangle(), and MaxOS::common::Rectangle< Type >::subtract().
| Type MaxOS::common::Rectangle< Type >::top { 0 } |
The top coordinate of the rectangle.
Definition at line 25 of file rectangle.h.
Referenced by MaxOS::gui::Widget::absolute_coordinates(), MaxOS::gui::Window::add_child(), MaxOS::common::Rectangle< Type >::contains(), MaxOS::common::Rectangle< Type >::contains(), MaxOS::gui::widgets::Button::draw(), MaxOS::gui::widgets::InputBox::draw(), MaxOS::gui::widgets::Text::draw(), MaxOS::gui::CompositeWidget::draw(), MaxOS::gui::Desktop::draw_self(), MaxOS::gui::Window::draw_self(), MaxOS::gui::Font::draw_text(), MaxOS::common::Rectangle< Type >::intersection(), MaxOS::common::Rectangle< Type >::intersects(), MaxOS::gui::Widget::move(), MaxOS::gui::CompositeWidget::on_mouse_button_pressed(), MaxOS::gui::CompositeWidget::on_mouse_button_released(), MaxOS::gui::CompositeWidget::on_mouse_enter_widget(), MaxOS::gui::CompositeWidget::on_mouse_leave_widget(), MaxOS::gui::WidgetMoverResizer< Left, Top, Width, Height >::on_mouse_move_event(), MaxOS::common::Rectangle< Type >::Rectangle(), and MaxOS::common::Rectangle< Type >::subtract().
| Type MaxOS::common::Rectangle< Type >::width { 0 } |
The width of the rectangle.
Definition at line 26 of file rectangle.h.
Referenced by MaxOS::common::Rectangle< Type >::contains(), MaxOS::common::Rectangle< Type >::contains(), MaxOS::gui::Desktop::Desktop(), MaxOS::gui::widgets::Button::draw(), MaxOS::gui::widgets::InputBox::draw(), MaxOS::gui::widgets::Text::draw(), MaxOS::gui::Desktop::draw_self(), MaxOS::gui::Window::draw_self(), MaxOS::gui::Font::draw_text(), MaxOS::common::Rectangle< Type >::intersection(), MaxOS::common::Rectangle< Type >::intersects(), MaxOS::gui::Widget::invalidate(), MaxOS::gui::Window::on_mouse_button_pressed(), MaxOS::gui::Desktop::on_mouse_move_event(), MaxOS::gui::WidgetMoverResizer< Left, Top, Width, Height >::on_mouse_move_event(), MaxOS::drivers::console::VESABootConsole::print_logo(), MaxOS::common::Rectangle< Type >::Rectangle(), MaxOS::gui::Widget::resize(), MaxOS::drivers::console::VESABootConsole::scroll_up(), MaxOS::common::Rectangle< Type >::subtract(), MaxOS::drivers::console::VESABootConsole::update_progress_bar(), and MaxOS::drivers::console::VESABootConsole::width().