libscratchcpp
A library for C++ based Scratch project players
Toggle main menu visibility
Loading...
Searching...
No Matches
rect.h
Go to the documentation of this file.
1
// SPDX-License-Identifier: Apache-2.0
2
3
#pragma once
4
5
#include "
global.h
"
6
#include "spimpl.h"
7
8
namespace
libscratchcpp
9
{
10
11
class
RectPrivate;
12
14
class
LIBSCRATCHCPP_EXPORT
Rect
15
{
16
public
:
17
Rect
(
double
left
,
double
top
,
double
right
,
double
bottom
);
18
Rect
();
19
20
double
left
()
const
;
21
void
setLeft
(
double
left
);
22
23
double
top
()
const
;
24
void
setTop
(
double
top
);
25
26
double
right
()
const
;
27
void
setRight
(
double
right
);
28
29
double
bottom
()
const
;
30
void
setBottom
(
double
bottom
);
31
32
double
width
()
const
;
33
double
height
()
const
;
34
35
void
clamp
(
double
left
,
double
top
,
double
right
,
double
bottom
);
36
void
snapToInt
();
37
38
bool
intersects
(
const
Rect
&rect)
const
;
39
bool
contains
(
double
x,
double
y)
const
;
40
41
static
void
intersected
(
const
Rect
&a,
const
Rect
&b,
Rect
&dst);
42
static
void
united
(
const
Rect
&a,
const
Rect
&b,
Rect
&dst);
43
44
private
:
45
spimpl::impl_ptr<RectPrivate> impl;
46
};
47
48
}
// namespace libscratchcpp
libscratchcpp::Rect::setBottom
void setBottom(double bottom)
Definition
rect.cpp:64
libscratchcpp::Rect::setLeft
void setLeft(double left)
Definition
rect.cpp:28
libscratchcpp::Rect::width
double width() const
Definition
rect.cpp:70
libscratchcpp::Rect::clamp
void clamp(double left, double top, double right, double bottom)
Definition
rect.cpp:92
libscratchcpp::Rect::Rect
Rect(double left, double top, double right, double bottom)
Definition
rect.cpp:10
libscratchcpp::Rect::intersects
bool intersects(const Rect &rect) const
Definition
rect.cpp:107
libscratchcpp::Rect::left
double left() const
Definition
rect.cpp:22
libscratchcpp::Rect::bottom
double bottom() const
Definition
rect.cpp:58
libscratchcpp::Rect::top
double top() const
Definition
rect.cpp:34
libscratchcpp::Rect::setRight
void setRight(double right)
Definition
rect.cpp:52
libscratchcpp::Rect::setTop
void setTop(double top)
Definition
rect.cpp:40
libscratchcpp::Rect::contains
bool contains(double x, double y) const
Definition
rect.cpp:126
libscratchcpp::Rect::intersected
static void intersected(const Rect &a, const Rect &b, Rect &dst)
Definition
rect.cpp:142
libscratchcpp::Rect::right
double right() const
Definition
rect.cpp:46
libscratchcpp::Rect::height
double height() const
Definition
rect.cpp:76
libscratchcpp::Rect::united
static void united(const Rect &a, const Rect &b, Rect &dst)
Definition
rect.cpp:151
libscratchcpp::Rect::snapToInt
void snapToInt()
Definition
rect.cpp:82
global.h
LIBSCRATCHCPP_EXPORT
#define LIBSCRATCHCPP_EXPORT
Definition
global.h:17
libscratchcpp
The main namespace of the library.
Definition
asset.h:10
include
scratchcpp
rect.h
Generated by
1.17.0