override public bool Execute() { bool nonEmpty; var rectangle = ActiveImage.Selection.Bounds(out nonEmpty); if (nonEmpty) { ActiveDrawable.EditCopy(); ActiveDrawable.EditPaste(false); ActiveImage.FloatingSelection.Offsets = new Offset(rectangle.X1, rectangle.Y1); var layer = ActiveImage.FloatingSelection.ToLayer(); // Fix me: why can't I use layer here? var dummy = new Layer(ActiveImage.ActiveDrawable) { Name = "Layer 1" }; dummy.ResizeToImageSize(); } else { var image = ActiveImage; var layer = new Layer(SelectedLayer) { Name = "Layer 1" }; image.InsertLayer(layer, 0); image.ActiveLayer = layer; SelectedLayer = layer; } return(true); }
override public bool Execute() { var selection = ActiveDrawable.EditPaste(false); selection.ToLayer(); selection.Name = "Layer 1"; SelectedLayer = selection; return(true); }
override public bool Execute() { bool nonEmpty; Rectangle rectangle = ActiveImage.Selection.Bounds(out nonEmpty); if (nonEmpty) { ActiveDrawable.EditCut(); ActiveDrawable.EditPaste(false); ActiveImage.FloatingSelection.Offsets = new Offset(rectangle.X1, rectangle.Y1); Layer layer = ActiveImage.FloatingSelection.ToLayer(); // Fix me: why can't I use layer here? new Layer(ActiveImage.ActiveDrawable).ResizeToImageSize(); } else { // TODO: what does PS handle this? } return(true); }
override public bool Execute() { ActiveDrawable.EditPaste(true); return(true); }