File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ pub struct Pivot {
1616 pivot : Option < DVec2 > ,
1717 /// The old pivot position in the GUI, used to reduce refreshes of the document bar
1818 pub old_pivot_position : ReferencePoint ,
19+ /// The last ReferencePoint which wasn't none
20+ pub last_non_none_reference : ReferencePoint ,
1921 /// Used to enable and disable the pivot
2022 active : bool ,
2123}
@@ -27,6 +29,7 @@ impl Default for Pivot {
2729 transform_from_normalized : Default :: default ( ) ,
2830 pivot : Default :: default ( ) ,
2931 old_pivot_position : ReferencePoint :: Center ,
32+ last_non_none_reference : ReferencePoint :: Center ,
3033 active : true ,
3134 }
3235 }
Original file line number Diff line number Diff line change @@ -1076,6 +1076,8 @@ impl Fsm for SelectToolFsmState {
10761076 let extend = input. keyboard . key ( extend_selection) ;
10771077 if !extend && !input. keyboard . key ( remove_from_selection) {
10781078 responses. add ( DocumentMessage :: DeselectAllLayers ) ;
1079+ let position = tool_data. pivot . last_non_none_reference ;
1080+ responses. add ( SelectToolMessage :: SetPivot { position } ) ;
10791081 tool_data. layers_dragging . clear ( ) ;
10801082 }
10811083
@@ -1571,6 +1573,7 @@ impl Fsm for SelectToolFsmState {
15711573 ( _, SelectToolMessage :: SetPivot { position } ) => {
15721574 responses. add ( DocumentMessage :: StartTransaction ) ;
15731575
1576+ tool_data. pivot . last_non_none_reference = position;
15741577 let pos: Option < DVec2 > = position. into ( ) ;
15751578 tool_data. pivot . set_normalized_position ( pos. unwrap ( ) ) ;
15761579 let dot = tool_data. get_as_dot ( ) ;
You can’t perform that action at this time.
0 commit comments