summaryrefslogtreecommitdiff
path: root/scene/gui/nine_patch_rect.h
diff options
context:
space:
mode:
Diffstat (limited to 'scene/gui/nine_patch_rect.h')
-rw-r--r--scene/gui/nine_patch_rect.h19
1 files changed, 10 insertions, 9 deletions
diff --git a/scene/gui/nine_patch_rect.h b/scene/gui/nine_patch_rect.h
index 0ef7f6b299..f9a3f31fe5 100644
--- a/scene/gui/nine_patch_rect.h
+++ b/scene/gui/nine_patch_rect.h
@@ -5,8 +5,8 @@
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
+/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -34,7 +34,6 @@
#include "scene/gui/control.h"
class NinePatchRect : public Control {
-
GDCLASS(NinePatchRect, Control);
public:
@@ -44,24 +43,25 @@ public:
AXIS_STRETCH_MODE_TILE_FIT,
};
- bool draw_center;
- int margin[4];
+ bool draw_center = true;
+ int margin[4] = {};
Rect2 region_rect;
Ref<Texture2D> texture;
- AxisStretchMode axis_h, axis_v;
+ AxisStretchMode axis_h = AXIS_STRETCH_MODE_STRETCH;
+ AxisStretchMode axis_v = AXIS_STRETCH_MODE_STRETCH;
protected:
void _notification(int p_what);
- virtual Size2 get_minimum_size() const;
+ virtual Size2 get_minimum_size() const override;
static void _bind_methods();
public:
void set_texture(const Ref<Texture2D> &p_tex);
Ref<Texture2D> get_texture() const;
- void set_patch_margin(Margin p_margin, int p_size);
- int get_patch_margin(Margin p_margin) const;
+ void set_patch_margin(Side p_side, int p_size);
+ int get_patch_margin(Side p_side) const;
void set_region_rect(const Rect2 &p_region_rect);
Rect2 get_region_rect() const;
@@ -80,4 +80,5 @@ public:
};
VARIANT_ENUM_CAST(NinePatchRect::AxisStretchMode)
+
#endif // NINE_PATCH_RECT_H