WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
File tree Expand file tree Collapse file tree 7 files changed +11
-13
lines changed
Expand file tree Collapse file tree 7 files changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -161,14 +161,13 @@ impl MenuState {
161161 if state. last_visible_pass + 1 < pass_nr {
162162 state. open_item = None ;
163163 }
164- if let Some ( item) = state. open_item {
165- if data
164+ if let Some ( item) = state. open_item
165+ && data
166166 . get_temp ( item. with ( Self :: ID ) )
167167 . is_none_or ( |item : Self | item. last_visible_pass + 1 < pass_nr)
168- {
169- // If the open item wasn't shown for at least a frame, reset the open item
170- state. open_item = None ;
171- }
168+ {
169+ // If the open item wasn't shown for at least a frame, reset the open item
170+ state. open_item = None ;
172171 }
173172 let r = f ( & mut state) ;
174173 data. insert_temp ( state_id, state) ;
Original file line number Diff line number Diff line change @@ -1272,8 +1272,7 @@ impl Areas {
12721272 pub fn top_layer_id ( & self , order : Order ) -> Option < LayerId > {
12731273 self . order
12741274 . iter ( )
1275- . filter ( |layer| layer. order == order && !self . is_sublayer ( layer) )
1276- . next_back ( )
1275+ . rfind ( |layer| layer. order == order && !self . is_sublayer ( layer) )
12771276 . copied ( )
12781277 }
12791278
Original file line number Diff line number Diff line change @@ -634,7 +634,7 @@ impl SubMenu {
634634/// Usually you don't need to use it directly.
635635pub struct MenuState {
636636 /// The opened sub-menu and its [`Id`]
637- sub_menu : Option < ( Id , Arc < RwLock < MenuState > > ) > ,
637+ sub_menu : Option < ( Id , Arc < RwLock < Self > > ) > ,
638638
639639 /// Bounding box of this menu (without the sub-menu),
640640 /// including the frame and everything.
Original file line number Diff line number Diff line change @@ -209,7 +209,7 @@ pub struct UiStack {
209209 pub layout_direction : Direction ,
210210 pub min_rect : Rect ,
211211 pub max_rect : Rect ,
212- pub parent : Option < Arc < UiStack > > ,
212+ pub parent : Option < Arc < Self > > ,
213213}
214214
215215// these methods act on this specific node
Original file line number Diff line number Diff line change @@ -451,7 +451,7 @@ enum Action {
451451
452452#[ derive( Clone , Default ) ]
453453#[ cfg_attr( feature = "serde" , derive( serde:: Deserialize , serde:: Serialize ) ) ]
454- struct Tree ( Vec < Tree > ) ;
454+ struct Tree ( Vec < Self > ) ;
455455
456456impl Tree {
457457 pub fn demo ( ) -> Self {
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ pub enum Shape {
3030
3131 /// Recursively nest more shapes - sometimes a convenience to be able to do.
3232 /// For performance reasons it is better to avoid it.
33- Vec ( Vec < Shape > ) ,
33+ Vec ( Vec < Self > ) ,
3434
3535 /// Circle with optional outline and fill.
3636 Circle ( CircleShape ) ,
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ pub struct ViewportState {
3131 pub visible : bool ,
3232 pub immediate : bool ,
3333 pub title : String ,
34- pub children : Vec < Arc < RwLock < ViewportState > > > ,
34+ pub children : Vec < Arc < RwLock < Self > > > ,
3535}
3636
3737impl ViewportState {
You can’t perform that action at this time.
0 commit comments