Turn OS.set_min/max_window_size() warnings into errors

Since invalid values will cause the setting to be discarded,
it makes more sense to display an error message instead of a
warning message.
This commit is contained in:
Hugo Locurcio 2019-07-30 14:50:52 +02:00
parent 7d76f3b393
commit 7de2c70e11
No known key found for this signature in database
GPG key ID: 39E8F8BE30B0A49C
3 changed files with 6 additions and 6 deletions

View file

@ -2411,7 +2411,7 @@ Size2 OS_OSX::get_min_window_size() const {
void OS_OSX::set_min_window_size(const Size2 p_size) {
if ((p_size != Size2()) && (max_size != Size2()) && ((p_size.x > max_size.x) || (p_size.y > max_size.y))) {
WARN_PRINT("Minimum window size can't be larger than maximum window size!");
ERR_PRINT("Minimum window size can't be larger than maximum window size!");
return;
}
min_size = p_size;
@ -2427,7 +2427,7 @@ void OS_OSX::set_min_window_size(const Size2 p_size) {
void OS_OSX::set_max_window_size(const Size2 p_size) {
if ((p_size != Size2()) && ((p_size.x < min_size.x) || (p_size.y < min_size.y))) {
WARN_PRINT("Maximum window size can't be smaller than minimum window size!");
ERR_PRINT("Maximum window size can't be smaller than minimum window size!");
return;
}
max_size = p_size;

View file

@ -1813,7 +1813,7 @@ Size2 OS_Windows::get_min_window_size() const {
void OS_Windows::set_min_window_size(const Size2 p_size) {
if ((p_size != Size2()) && (max_size != Size2()) && ((p_size.x > max_size.x) || (p_size.y > max_size.y))) {
WARN_PRINT("Minimum window size can't be larger than maximum window size!");
ERR_PRINT("Minimum window size can't be larger than maximum window size!");
return;
}
min_size = p_size;
@ -1822,7 +1822,7 @@ void OS_Windows::set_min_window_size(const Size2 p_size) {
void OS_Windows::set_max_window_size(const Size2 p_size) {
if ((p_size != Size2()) && ((p_size.x < min_size.x) || (p_size.y < min_size.y))) {
WARN_PRINT("Maximum window size can't be smaller than minimum window size!");
ERR_PRINT("Maximum window size can't be smaller than minimum window size!");
return;
}
max_size = p_size;

View file

@ -1266,7 +1266,7 @@ Size2 OS_X11::get_min_window_size() const {
void OS_X11::set_min_window_size(const Size2 p_size) {
if ((p_size != Size2()) && (max_size != Size2()) && ((p_size.x > max_size.x) || (p_size.y > max_size.y))) {
WARN_PRINT("Minimum window size can't be larger than maximum window size!");
ERR_PRINT("Minimum window size can't be larger than maximum window size!");
return;
}
min_size = p_size;
@ -1295,7 +1295,7 @@ void OS_X11::set_min_window_size(const Size2 p_size) {
void OS_X11::set_max_window_size(const Size2 p_size) {
if ((p_size != Size2()) && ((p_size.x < min_size.x) || (p_size.y < min_size.y))) {
WARN_PRINT("Maximum window size can't be smaller than minimum window size!");
ERR_PRINT("Maximum window size can't be smaller than minimum window size!");
return;
}
max_size = p_size;