"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "Pinta.Gui.Widgets/Widgets/Canvas/CanvasRenderer.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).

CanvasRenderer.cs  (pinta-1.7):CanvasRenderer.cs  (pinta-1.7.1)
skipping to change at line 84 skipping to change at line 84
layer = CreateLivePreviewLayer (layer); layer = CreateLivePreviewLayer (layer);
// If the layer is offset, handle it here // If the layer is offset, handle it here
if (!layer.Transform.IsIdentity ()) if (!layer.Transform.IsIdentity ())
layer = CreateOffsetLayer (layer); layer = CreateOffsetLayer (layer);
// No need to resize the surface if we're at 100% zoom // No need to resize the surface if we're at 100% zoom
if (scale_factor.Ratio == 1) if (scale_factor.Ratio == 1)
layer.Draw (g, layer.Surface, layer.Opacity, false); layer.Draw (g, layer.Surface, layer.Opacity, false);
else { else {
using (var scaled = new Cairo.ImageSurface (Cairo.Format .Argb32, dst.Width, dst.Height)) { using (var scaled = CairoExtensions.CreateImageSurface ( Cairo.Format.Argb32, dst.Width, dst.Height)) {
g.Save (); g.Save ();
// Have to undo the translate set above // Have to undo the translate set above
g.Translate (offset.X, offset.Y); g.Translate (offset.X, offset.Y);
CopyScaled (layer.Surface, scaled, r.ToGdkRectangle ()); CopyScaled (layer.Surface, scaled, r.ToGdkRectangle ());
layer.Draw (g, scaled, layer.Opacity, false); layer.Draw (g, scaled, layer.Opacity, false);
g.Restore (); g.Restore ();
} }
} }
} }
} }
skipping to change at line 106 skipping to change at line 106
// If we are at least 200% and grid is requested, draw it // If we are at least 200% and grid is requested, draw it
if (enable_pixel_grid && PintaCore.Actions.View.PixelGrid.Active && scale_factor.Ratio <= 0.5d) if (enable_pixel_grid && PintaCore.Actions.View.PixelGrid.Active && scale_factor.Ratio <= 0.5d)
RenderPixelGrid (dst, offset); RenderPixelGrid (dst, offset);
dst.MarkDirty (); dst.MarkDirty ();
} }
private Layer OffsetLayer { private Layer OffsetLayer {
get { get {
// Create one if we don't have one // Create one if we don't have one
if (offset_layer == null) if (offset_layer == null) {
offset_layer = new Layer (new Cairo.Image var surf = CairoExtensions.CreateImageSur
Surface (Cairo.Format.ARGB32, source_size.Width, source_size.Height)); face (Cairo.Format.ARGB32, source_size.Width, source_size.Height);
offset_layer = new Layer (surf);
}
// If we have the wrong size one, dispose it and create the correct size // If we have the wrong size one, dispose it and create the correct size
if (offset_layer.Surface.Width != source_size.Wid th || offset_layer.Surface.Height != source_size.Height) { if (offset_layer.Surface.Width != source_size.Wid th || offset_layer.Surface.Height != source_size.Height) {
(offset_layer.Surface as IDisposable).Dis pose (); (offset_layer.Surface as IDisposable).Dis pose ();
offset_layer = new Layer (new Cairo.Image var surf = CairoExtensions.CreateImageSur
Surface (Cairo.Format.ARGB32, source_size.Width, source_size.Height)); face (Cairo.Format.ARGB32, source_size.Width, source_size.Height);
offset_layer = new Layer ();
} }
return offset_layer; return offset_layer;
} }
} }
private Layer CreateLivePreviewLayer (Layer original) private Layer CreateLivePreviewLayer (Layer original)
{ {
var preview_layer = new Layer (PintaCore.LivePreview.Live PreviewSurface); var preview_layer = new Layer (PintaCore.LivePreview.Live PreviewSurface);
 End of changes. 3 change blocks. 
6 lines changed or deleted 9 lines changed or added

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