public void FinishSelection()
{
// We don't have an uncommitted layer, abort
if (!ShowSelectionLayer)
return;
FinishPixelsHistoryItem hist = new FinishPixelsHistoryItem ();
hist.TakeSnapshot ();
Layer layer = SelectionLayer;
using (Cairo.Context g = new Cairo.Context (CurrentUserLayer.Surface)) {
selection.Clip (g);
layer.DrawWithOperator(g, layer.Surface, Operator.Source, 1.0f, true);
}
DestroySelectionLayer ();
Workspace.Invalidate ();
Workspace.History.PushNewItem (hist);
}