summaryrefslogtreecommitdiff
path: root/core/math/rect2.h
diff options
context:
space:
mode:
authorreduz <reduzio@gmail.com>2020-10-13 15:59:37 -0300
committerJuan Linietsky <reduzio@gmail.com>2020-10-14 15:24:30 +0200
commitb8c64184c628dba6b54b4beb5a38e292a182bd6f (patch)
tree7ffaba5d7fecfb9d16e0c47a18ffdd98117a2eea /core/math/rect2.h
parentbc91e088e4503bbf1c5800282f2974011a4cc8e8 (diff)
Refactored binding system for core types
Moved to a system using variadic templates, shared with CallableBind. New code is cleaner, faster and allows for much better optimization of core type functions from GDScript and GDNative. Added Variant::InternalMethod function for direct call access.
Diffstat (limited to 'core/math/rect2.h')
-rw-r--r--core/math/rect2.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/math/rect2.h b/core/math/rect2.h
index 14393325ec..7660db71eb 100644
--- a/core/math/rect2.h
+++ b/core/math/rect2.h
@@ -197,6 +197,10 @@ struct Rect2 {
return g;
}
+ inline Rect2 grow_margin_bind(uint32_t p_margin, real_t p_amount) const {
+ return grow_margin(Margin(p_margin), p_amount);
+ }
+
inline Rect2 grow_individual(real_t p_left, real_t p_top, real_t p_right, real_t p_bottom) const {
Rect2 g = *this;
g.position.x -= p_left;
@@ -363,6 +367,10 @@ struct Rect2i {
return g;
}
+ inline Rect2i grow_margin_bind(uint32_t p_margin, int p_amount) const {
+ return grow_margin(Margin(p_margin), p_amount);
+ }
+
inline Rect2i grow_individual(int p_left, int p_top, int p_right, int p_bottom) const {
Rect2i g = *this;
g.position.x -= p_left;