summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authortoger5 <toger5@hotmail.de>2017-08-31 15:11:10 +0200
committertoger5 <toger5@hotmail.de>2017-08-31 15:25:24 +0200
commit2aa735757a31d4ae02ed72f76dedc98a851c3f7d (patch)
tree827630418b2e5ba855f4a18da760aa26d4270a38 /scene
parent41e1bbd30c1e6db57e3fbbc037f6ce4645e20fb9 (diff)
unified draw_center naming for (9patch,StyleBoxes)
- filled -> draw_center - is_draw_center -> is_draw_center_enabled - get_draw_center -> is_draw_center_enabled
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/patch_9_rect.cpp10
-rw-r--r--scene/gui/patch_9_rect.h4
-rw-r--r--scene/resources/style_box.cpp30
-rw-r--r--scene/resources/style_box.h12
4 files changed, 28 insertions, 28 deletions
diff --git a/scene/gui/patch_9_rect.cpp b/scene/gui/patch_9_rect.cpp
index 6b2deeb209..92c34dd3f9 100644
--- a/scene/gui/patch_9_rect.cpp
+++ b/scene/gui/patch_9_rect.cpp
@@ -61,7 +61,7 @@ void NinePatchRect::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_region_rect", "rect"), &NinePatchRect::set_region_rect);
ClassDB::bind_method(D_METHOD("get_region_rect"), &NinePatchRect::get_region_rect);
ClassDB::bind_method(D_METHOD("set_draw_center", "draw_center"), &NinePatchRect::set_draw_center);
- ClassDB::bind_method(D_METHOD("get_draw_center"), &NinePatchRect::get_draw_center);
+ ClassDB::bind_method(D_METHOD("is_draw_center_enabled"), &NinePatchRect::is_draw_center_enabled);
ClassDB::bind_method(D_METHOD("set_h_axis_stretch_mode", "mode"), &NinePatchRect::set_h_axis_stretch_mode);
ClassDB::bind_method(D_METHOD("get_h_axis_stretch_mode"), &NinePatchRect::get_h_axis_stretch_mode);
ClassDB::bind_method(D_METHOD("set_v_axis_stretch_mode", "mode"), &NinePatchRect::set_v_axis_stretch_mode);
@@ -70,7 +70,7 @@ void NinePatchRect::_bind_methods() {
ADD_SIGNAL(MethodInfo("texture_changed"));
ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT, "texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture"), "set_texture", "get_texture");
- ADD_PROPERTYNO(PropertyInfo(Variant::BOOL, "draw_center"), "set_draw_center", "get_draw_center");
+ ADD_PROPERTYNO(PropertyInfo(Variant::BOOL, "draw_center"), "set_draw_center", "is_draw_center_enabled");
ADD_PROPERTYNZ(PropertyInfo(Variant::RECT2, "region_rect"), "set_region_rect", "get_region_rect");
ADD_GROUP("Patch Margin", "patch_margin_");
@@ -151,13 +151,13 @@ Rect2 NinePatchRect::get_region_rect() const {
return region_rect;
}
-void NinePatchRect::set_draw_center(bool p_draw) {
+void NinePatchRect::set_draw_center(bool p_enabled) {
- draw_center = p_draw;
+ draw_center = p_enabled;
update();
}
-bool NinePatchRect::get_draw_center() const {
+bool NinePatchRect::is_draw_center_enabled() const {
return draw_center;
}
diff --git a/scene/gui/patch_9_rect.h b/scene/gui/patch_9_rect.h
index 4cf93e4c05..808b7a1f5d 100644
--- a/scene/gui/patch_9_rect.h
+++ b/scene/gui/patch_9_rect.h
@@ -67,8 +67,8 @@ public:
void set_region_rect(const Rect2 &p_region_rect);
Rect2 get_region_rect() const;
- void set_draw_center(bool p_draw);
- bool get_draw_center() const;
+ void set_draw_center(bool p_enabled);
+ bool is_draw_center_enabled() const;
void set_h_axis_stretch_mode(AxisStretchMode p_mode);
AxisStretchMode get_h_axis_stretch_mode() const;
diff --git a/scene/resources/style_box.cpp b/scene/resources/style_box.cpp
index f646e3667d..b8a0a7864e 100644
--- a/scene/resources/style_box.cpp
+++ b/scene/resources/style_box.cpp
@@ -165,13 +165,13 @@ void StyleBoxTexture::draw(RID p_canvas_item, const Rect2 &p_rect) const {
VisualServer::get_singleton()->canvas_item_add_nine_patch(p_canvas_item, rect, src_rect, texture->get_rid(), Vector2(margin[MARGIN_LEFT], margin[MARGIN_TOP]), Vector2(margin[MARGIN_RIGHT], margin[MARGIN_BOTTOM]), VS::NinePatchAxisMode(axis_h), VS::NinePatchAxisMode(axis_v), draw_center, modulate, normal_rid);
}
-void StyleBoxTexture::set_draw_center(bool p_draw) {
+void StyleBoxTexture::set_draw_center(bool p_enabled) {
- draw_center = p_draw;
+ draw_center = p_enabled;
emit_changed();
}
-bool StyleBoxTexture::get_draw_center() const {
+bool StyleBoxTexture::is_draw_center_enabled() const {
return draw_center;
}
@@ -281,7 +281,7 @@ void StyleBoxTexture::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_region_rect"), &StyleBoxTexture::get_region_rect);
ClassDB::bind_method(D_METHOD("set_draw_center", "enable"), &StyleBoxTexture::set_draw_center);
- ClassDB::bind_method(D_METHOD("get_draw_center"), &StyleBoxTexture::get_draw_center);
+ ClassDB::bind_method(D_METHOD("is_draw_center_enabled"), &StyleBoxTexture::is_draw_center_enabled);
ClassDB::bind_method(D_METHOD("set_modulate", "color"), &StyleBoxTexture::set_modulate);
ClassDB::bind_method(D_METHOD("get_modulate"), &StyleBoxTexture::get_modulate);
@@ -312,7 +312,7 @@ void StyleBoxTexture::_bind_methods() {
ADD_PROPERTYNZ(PropertyInfo(Variant::INT, "axis_stretch_vertical", PROPERTY_HINT_ENUM, "Stretch,Tile,Tile Fit"), "set_v_axis_stretch_mode", "get_v_axis_stretch_mode");
ADD_GROUP("Modulate", "modulate_");
ADD_PROPERTY(PropertyInfo(Variant::COLOR, "modulate_color"), "set_modulate", "get_modulate");
- ADD_PROPERTY(PropertyInfo(Variant::BOOL, "draw_center"), "set_draw_center", "get_draw_center");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "draw_center"), "set_draw_center", "is_draw_center_enabled");
BIND_ENUM_CONSTANT(AXIS_STRETCH_MODE_STRETCH);
BIND_ENUM_CONSTANT(AXIS_STRETCH_MODE_TILE);
@@ -460,14 +460,14 @@ float StyleBoxFlat::get_expand_margin_size(Margin p_expand_margin) const {
return expand_margin[p_expand_margin];
}
-void StyleBoxFlat::set_filled(bool p_filled) {
+void StyleBoxFlat::set_draw_center(bool p_enabled) {
- filled = p_filled;
+ draw_center = p_enabled;
emit_changed();
}
-bool StyleBoxFlat::is_filled() const {
+bool StyleBoxFlat::is_draw_center_enabled() const {
- return filled;
+ return draw_center;
}
void StyleBoxFlat::set_shadow_color(const Color &p_color) {
@@ -691,7 +691,7 @@ void StyleBoxFlat::draw(RID p_canvas_item, const Rect2 &p_rect) const {
style_rect, adapted_border, inner_color, border_color.read().ptr(), corner_detail);
//DRAW INFILL
- if (filled) {
+ if (draw_center) {
int temp_vert_offset = verts.size();
int no_border[4] = { 0, 0, 0, 0 };
draw_ring(verts, indices, colors, style_rect, adapted_corner,
@@ -724,7 +724,7 @@ void StyleBoxFlat::draw(RID p_canvas_item, const Rect2 &p_rect) const {
int aa_border_width[4] = { aa_size, aa_size, aa_size, aa_size };
- if (filled) {
+ if (draw_center) {
if (!blend_border) {
//INFILL AA
draw_ring(verts, indices, colors, style_rect, adapted_corner,
@@ -776,8 +776,8 @@ void StyleBoxFlat::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_expand_margin_individual", "size_left", "size_top", "size_right", "size_bottom"), &StyleBoxFlat::set_expand_margin_size_individual);
ClassDB::bind_method(D_METHOD("get_expand_margin", "margin"), &StyleBoxFlat::get_expand_margin_size);
- ClassDB::bind_method(D_METHOD("set_filled", "filled"), &StyleBoxFlat::set_filled);
- ClassDB::bind_method(D_METHOD("is_filled"), &StyleBoxFlat::is_filled);
+ ClassDB::bind_method(D_METHOD("set_draw_center", "draw_center"), &StyleBoxFlat::set_draw_center);
+ ClassDB::bind_method(D_METHOD("is_draw_center_enabled"), &StyleBoxFlat::is_draw_center_enabled);
ClassDB::bind_method(D_METHOD("set_shadow_color", "color"), &StyleBoxFlat::set_shadow_color);
ClassDB::bind_method(D_METHOD("get_shadow_color"), &StyleBoxFlat::get_shadow_color);
@@ -796,7 +796,7 @@ void StyleBoxFlat::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::COLOR, "bg_color"), "set_bg_color", "get_bg_color");
- ADD_PROPERTY(PropertyInfo(Variant::BOOL, "filled"), "set_filled", "is_filled");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "draw_center"), "set_draw_center", "is_draw_center_enabled");
ADD_GROUP("Border Width", "border_width_");
ADD_PROPERTYI(PropertyInfo(Variant::INT, "border_width_left", PROPERTY_HINT_RANGE, "0,1024,1"), "set_border_width", "get_border_width", MARGIN_LEFT);
@@ -843,7 +843,7 @@ StyleBoxFlat::StyleBoxFlat() {
border_color.append(Color(0.8, 0.8, 0.8));
blend_border = false;
- filled = true;
+ draw_center = true;
anti_aliased = true;
shadow_size = 0;
diff --git a/scene/resources/style_box.h b/scene/resources/style_box.h
index db41333b7e..3d085f7166 100644
--- a/scene/resources/style_box.h
+++ b/scene/resources/style_box.h
@@ -117,8 +117,8 @@ public:
void set_normal_map(RES p_normal_map);
RES get_normal_map() const;
- void set_draw_center(bool p_draw);
- bool get_draw_center() const;
+ void set_draw_center(bool p_enabled);
+ bool is_draw_center_enabled() const;
virtual Size2 get_center_size() const;
void set_h_axis_stretch_mode(AxisStretchMode p_mode);
@@ -150,7 +150,7 @@ class StyleBoxFlat : public StyleBox {
int expand_margin[4];
int corner_radius[4];
- bool filled;
+ bool draw_center;
bool blend_border;
bool anti_aliased;
@@ -202,9 +202,9 @@ public:
void set_expand_margin_size_individual(float p_left, float p_top, float p_right, float p_bottom);
float get_expand_margin_size(Margin p_expand_margin) const;
- //FILLED
- void set_filled(bool p_draw);
- bool is_filled() const;
+ //DRAW CENTER
+ void set_draw_center(bool p_enabled);
+ bool is_draw_center_enabled() const;
//SHADOW
void set_shadow_color(const Color &p_color);