File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -694,20 +694,22 @@ where
694
694
( id, e)
695
695
}
696
696
} ;
697
+
698
+ let parent_size = states
699
+ . get ( & origin_id)
700
+ . map ( |s| s. logical_size ( ) )
701
+ . unwrap_or_else ( || Size :: new ( 1024.0 , 1024.0 ) ) ;
702
+
697
703
let node =
698
- Widget :: layout ( e. as_widget ( ) , & renderer, & Limits :: NONE ) ;
704
+ Widget :: layout ( e. as_widget ( ) , & renderer, & Limits :: NONE . min_width ( 1 ) . min_height ( 1 ) . max_width ( parent_size . width as u32 ) . max_height ( parent_size . height as u32 ) ) ;
699
705
let bounds = node. bounds ( ) ;
700
706
let w = bounds. width . ceil ( ) as u32 ;
701
707
let h = bounds. height . ceil ( ) as u32 ;
702
708
if w == 0 || h == 0 {
703
709
error ! ( "Dnd surface has zero size, ignoring" ) ;
704
710
continue ;
705
711
}
706
- let parent_size = states
707
- . get ( & origin_id)
708
- . map ( |s| s. logical_size ( ) )
709
- . unwrap_or_else ( || Size :: new ( 1024.0 , 1024.0 ) ) ;
710
- if w > parent_size. width as u32 || h > parent_size. height as u32
712
+ if w > parent_size. width as u32 || h > parent_size. height as u32
711
713
{
712
714
error ! ( "Dnd surface is too large, ignoring" ) ;
713
715
continue ;
You can’t perform that action at this time.
0 commit comments