Skip to content

Commit

Permalink
wings_sel_cmd: Use wings_sel:unselected_ids/1
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorng committed Jul 26, 2018
1 parent e475ca4 commit 6061bb7
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/wings_sel_cmd.erl
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ select_all(#st{selmode=Mode}=St) ->
%%%

inverse(#st{selmode=body}=St) ->
Inverse = unselected_ids(St),
Inverse = wings_sel:unselected_ids(St),
wings_sel:make(fun(_, #we{id=Id}) ->
member(Id, Inverse)
end, body, St);
Expand Down Expand Up @@ -450,11 +450,11 @@ hide_selected(St) ->
wings_obj:hide(Selected, St).

hide_unselected(St) ->
Unselected = unselected_ids(St),
Unselected = wings_sel:unselected_ids(St),
wings_obj:hide(Unselected, St).

lock_unselected(St) ->
Unselected = unselected_ids(St),
Unselected = wings_sel:unselected_ids(St),
wings_obj:lock(Unselected, St).

%%%
Expand Down Expand Up @@ -1585,9 +1585,3 @@ intersect_sel_items(F, Mode, St0) when is_function(F, 2) ->
#st{} ->
wings_sel:update_sel(FF, Mode, St)
end.

unselected_ids(St) ->
FF = fun(#{id:=Id}, A) -> [Id|A] end,
AllIds = ordsets:from_list(wings_obj:fold(FF, [], St)),
SelIds = ordsets:from_list(wings_sel:selected_ids(St)),
ordsets:subtract(AllIds, SelIds).

0 comments on commit 6061bb7

Please sign in to comment.