MyScript Interactive Ink SDK 4.5.0
Rectangle.h
1// Copyright @ MyScript. All rights reserved.
2
3#pragma once
4
5#include <iink/Engine.h>
6
7#include <iosfwd>
8
9namespace myscript {
10namespace iink {
11namespace graphics {
12
17{
18 float x = 0.f;
19 float y = 0.f;
20 float width = 0.f;
21 float height = 0.f;
26 Rectangle() = default;
27
36 Rectangle(float x, float y, float width, float height) noexcept
37 : x(x)
38 , y(y)
39 , width(width)
40 , height(height)
41 {
42 }
43
51 bool operator==(const Rectangle& other) const noexcept
52 {
53 return x == other.x && y == other.y && width == other.width && height == other.height;
54 }
55
63 bool operator!=(const Rectangle& other) const noexcept
64 {
65 return x != other.x || y != other.y || width != other.width || height != other.height;
66 }
67
76 IINK_API friend std::ostream& operator<<(std::ostream& os, const Rectangle& rect);
77};
78
79}
80}
81}
Definition: Configuration.h:10
Definition: Rectangle.h:17
float x
Definition: Rectangle.h:18
Rectangle(float x, float y, float width, float height) noexcept
Definition: Rectangle.h:36
float y
Definition: Rectangle.h:19
float height
Definition: Rectangle.h:21
friend std::ostream & operator<<(std::ostream &os, const Rectangle &rect)
float width
Definition: Rectangle.h:20
bool operator!=(const Rectangle &other) const noexcept
Definition: Rectangle.h:63
bool operator==(const Rectangle &other) const noexcept
Definition: Rectangle.h:51