Merge pull request #52728 from jmb462/ninepatchrect_node_warning
This commit is contained in:
commit
d92405de74
@ -156,6 +156,7 @@ bool NinePatchRect::is_draw_center_enabled() const {
|
||||
|
||||
void NinePatchRect::set_h_axis_stretch_mode(AxisStretchMode p_mode) {
|
||||
axis_h = p_mode;
|
||||
update_configuration_warning();
|
||||
update();
|
||||
}
|
||||
|
||||
@ -165,6 +166,7 @@ NinePatchRect::AxisStretchMode NinePatchRect::get_h_axis_stretch_mode() const {
|
||||
|
||||
void NinePatchRect::set_v_axis_stretch_mode(AxisStretchMode p_mode) {
|
||||
axis_v = p_mode;
|
||||
update_configuration_warning();
|
||||
update();
|
||||
}
|
||||
|
||||
@ -172,6 +174,21 @@ NinePatchRect::AxisStretchMode NinePatchRect::get_v_axis_stretch_mode() const {
|
||||
return axis_v;
|
||||
}
|
||||
|
||||
String NinePatchRect::get_configuration_warning() const {
|
||||
String warning = Control::get_configuration_warning();
|
||||
|
||||
if (String(GLOBAL_GET("rendering/quality/driver/driver_name")) == "GLES2") {
|
||||
if (axis_v > AXIS_STRETCH_MODE_STRETCH || axis_h > AXIS_STRETCH_MODE_STRETCH) {
|
||||
if (!warning.empty()) {
|
||||
warning += "\n\n";
|
||||
}
|
||||
warning += TTR("The Tile and Tile Fit options for Axis Stretch properties are only effective when using the GLES3 rendering backend.\nThe GLES2 backend is currently in use, so these modes will act like Stretch instead.");
|
||||
}
|
||||
}
|
||||
|
||||
return warning;
|
||||
}
|
||||
|
||||
NinePatchRect::NinePatchRect() {
|
||||
margin[MARGIN_LEFT] = 0;
|
||||
margin[MARGIN_RIGHT] = 0;
|
||||
|
@ -74,6 +74,8 @@ public:
|
||||
void set_v_axis_stretch_mode(AxisStretchMode p_mode);
|
||||
AxisStretchMode get_v_axis_stretch_mode() const;
|
||||
|
||||
String get_configuration_warning() const;
|
||||
|
||||
NinePatchRect();
|
||||
~NinePatchRect();
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user