"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "Pinta.Core/Actions/EditActions.cs" between
pinta-1.7.tar.gz and pinta-1.7.1.tar.gz

About: Pinta is a powerful image drawing and editing program (modeled after Paint.NET).

EditActions.cs  (pinta-1.7):EditActions.cs  (pinta-1.7.1)
skipping to change at line 265 skipping to change at line 265
Document doc = PintaCore.Workspace.ActiveDocument; Document doc = PintaCore.Workspace.ActiveDocument;
PintaCore.Tools.Commit (); PintaCore.Tools.Commit ();
using (ImageSurface src = doc.GetClippedLayer (doc.Curren tUserLayerIndex)) { using (ImageSurface src = doc.GetClippedLayer (doc.Curren tUserLayerIndex)) {
Gdk.Rectangle rect = doc.GetSelectedBounds (true) ; Gdk.Rectangle rect = doc.GetSelectedBounds (true) ;
if (rect.Width == 0 || rect.Height == 0) if (rect.Width == 0 || rect.Height == 0)
return; return;
ImageSurface dest = new ImageSurface (Format.Argb 32, rect.Width, rect.Height); ImageSurface dest = CairoExtensions.CreateImageSu rface (Format.Argb32, rect.Width, rect.Height);
using (Context g = new Context (dest)) { using (Context g = new Context (dest)) {
g.SetSourceSurface (src, -rect.X, -rect.Y ); g.SetSourceSurface (src, -rect.X, -rect.Y );
g.Paint (); g.Paint ();
} }
cb.Image = dest.ToPixbuf (); cb.Image = dest.ToPixbuf ();
(dest as IDisposable).Dispose (); (dest as IDisposable).Dispose ();
} }
skipping to change at line 290 skipping to change at line 290
var cb = Gtk.Clipboard.Get (Gdk.Atom.Intern ("CLIPBOARD", false)); var cb = Gtk.Clipboard.Get (Gdk.Atom.Intern ("CLIPBOARD", false));
var doc = PintaCore.Workspace.ActiveDocument; var doc = PintaCore.Workspace.ActiveDocument;
PintaCore.Tools.Commit (); PintaCore.Tools.Commit ();
// Get our merged ("flattened") image // Get our merged ("flattened") image
using (var src = doc.GetFlattenedImage ()) { using (var src = doc.GetFlattenedImage ()) {
var rect = doc.GetSelectedBounds (true); var rect = doc.GetSelectedBounds (true);
// Copy it to a correctly sized surface // Copy it to a correctly sized surface
using (var dest = new ImageSurface (Format.Argb32 using (var dest = CairoExtensions.CreateImageSurf
, rect.Width, rect.Height)) { ace (Format.Argb32, rect.Width, rect.Height)) {
using (Context g = new Context (dest)) { using (Context g = new Context (dest)) {
g.SetSourceSurface (src, -rect.X, -rect.Y); g.SetSourceSurface (src, -rect.X, -rect.Y);
g.Paint (); g.Paint ();
} }
// Give it to the clipboard // Give it to the clipboard
cb.Image = dest.ToPixbuf (); cb.Image = dest.ToPixbuf ();
} }
} }
} }
 End of changes. 2 change blocks. 
3 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)