@@ -92,7 +92,7 @@ std::string region::serialize(const std::string& tab) const {
92
92
std::ostringstream str;
93
93
94
94
str << tab << " # Name : " << name_ << " ("
95
- << std::string (is_ready_ ? " ready " : " not ready " )
95
+ << std::string (is_valid_ ? " valid " : " not valid " )
96
96
<< std::string (is_manually_inherited_ ? " , manually inherited" : " " ) << " )\n " ;
97
97
str << tab << " # Raw name : " << raw_name_ << " \n " ;
98
98
str << tab << " # Type : " << get_region_type () << " \n " ;
@@ -208,6 +208,10 @@ bool region::is_visible() const {
208
208
return is_visible_;
209
209
}
210
210
211
+ bool region::is_valid () const {
212
+ return is_valid_;
213
+ }
214
+
211
215
void region::set_dimensions (const vector2f& dimensions) {
212
216
if (dimensions_ == dimensions)
213
217
return ;
@@ -668,10 +672,10 @@ void region::update_borders_() {
668
672
669
673
DEBUG_LOG (" Update anchors for " + lua_name_);
670
674
671
- const bool old_is_ready = is_ready_ ;
675
+ const bool old_is_ready = is_valid_ ;
672
676
const auto old_border_list = borders_;
673
677
674
- is_ready_ = true ;
678
+ is_valid_ = true ;
675
679
676
680
if (!anchor_list_.empty ()) {
677
681
float left = 0 .0f , right = 0 .0f , top = 0 .0f , bottom = 0 .0f ;
@@ -693,14 +697,14 @@ void region::update_borders_() {
693
697
694
698
DEBUG_LOG (" Make borders" );
695
699
if (!make_borders_ (top, bottom, y_center, rounded_height)) {
696
- is_ready_ = false ;
700
+ is_valid_ = false ;
697
701
}
698
702
699
703
if (!make_borders_ (left, right, x_center, rounded_width)) {
700
- is_ready_ = false ;
704
+ is_valid_ = false ;
701
705
}
702
706
703
- if (is_ready_ ) {
707
+ if (is_valid_ ) {
704
708
if (right < left) {
705
709
right = left + 1 ;
706
710
}
@@ -714,7 +718,7 @@ void region::update_borders_() {
714
718
}
715
719
} else {
716
720
borders_ = bounds2f (0.0 , 0.0 , dimensions_.x , dimensions_.y );
717
- is_ready_ = false ;
721
+ is_valid_ = false ;
718
722
}
719
723
720
724
DEBUG_LOG (" Final borders" );
@@ -728,7 +732,7 @@ void region::update_borders_() {
728
732
DEBUG_LOG (" top=" + utils::to_string (borders_.top ));
729
733
DEBUG_LOG (" bottom=" + utils::to_string (borders_.bottom ));
730
734
731
- if (borders_ != old_border_list || is_ready_ != old_is_ready) {
735
+ if (borders_ != old_border_list || is_valid_ != old_is_ready) {
732
736
DEBUG_LOG (" Fire redraw" );
733
737
notify_renderer_need_redraw ();
734
738
}
@@ -741,12 +745,12 @@ void region::notify_borders_need_update() {
741
745
if (is_virtual ())
742
746
return ;
743
747
744
- const bool old_ready = is_ready_ ;
748
+ const bool old_valid = is_valid_ ;
745
749
const auto old_border_list = borders_;
746
750
747
751
update_borders_ ();
748
752
749
- if (borders_ != old_border_list || is_ready_ != old_ready ) {
753
+ if (borders_ != old_border_list || is_valid_ != old_valid ) {
750
754
for (const auto & object : anchored_object_list_)
751
755
object->notify_borders_need_update ();
752
756
}
0 commit comments