BaseTool.cs (pinta-1.7) | : | BaseTool.cs (pinta-1.7.1) | ||
---|---|---|---|---|
skipping to change at line 35 | skipping to change at line 35 | |||
// THE SOFTWARE. | // THE SOFTWARE. | |||
using System; | using System; | |||
using Cairo; | using Cairo; | |||
using Gtk; | using Gtk; | |||
using Gdk; | using Gdk; | |||
using System.IO; | using System.IO; | |||
using Mono.Unix; | using Mono.Unix; | |||
using Mono.Addins; | using Mono.Addins; | |||
using System.Collections.Generic; | using System.Collections.Generic; | |||
using Pinta; | ||||
namespace Pinta.Core | namespace Pinta.Core | |||
{ | { | |||
public delegate void MouseHandler (double x, double y, Gdk.ModifierType s tate); | public delegate void MouseHandler (double x, double y, Gdk.ModifierType s tate); | |||
[TypeExtensionPoint] | [TypeExtensionPoint] | |||
public abstract class BaseTool | public abstract class BaseTool | |||
{ | { | |||
public const int DEFAULT_BRUSH_WIDTH = 2; | public const int DEFAULT_BRUSH_WIDTH = 2; | |||
skipping to change at line 398 | skipping to change at line 399 | |||
Gdk.Rectangle iconBBox = imgBBox.Union (shapeBBox); | Gdk.Rectangle iconBBox = imgBBox.Union (shapeBBox); | |||
// Image top-left corner in icon co-ordinates | // Image top-left corner in icon co-ordinates | |||
int imgX = imgBBox.Left - iconBBox.Left; | int imgX = imgBBox.Left - iconBBox.Left; | |||
int imgY = imgBBox.Top - iconBBox.Top; | int imgY = imgBBox.Top - iconBBox.Top; | |||
// Shape center point in icon co-ordinates | // Shape center point in icon co-ordinates | |||
shapeX = imgToShapeX - iconBBox.Left; | shapeX = imgToShapeX - iconBBox.Left; | |||
shapeY = imgToShapeY - iconBBox.Top; | shapeY = imgToShapeY - iconBBox.Top; | |||
using (ImageSurface i = new ImageSurface (Format.ARGB32, iconBBox.Width, iconBBox.Height)) { | using (ImageSurface i = CairoExtensions.CreateImageSurfac e (Format.ARGB32, iconBBox.Width, iconBBox.Height)) { | |||
using (Context g = new Context (i)) { | using (Context g = new Context (i)) { | |||
// Don't show shape if shapeWidth less th an 3, | // Don't show shape if shapeWidth less th an 3, | |||
if (shapeWidth > 3) { | if (shapeWidth > 3) { | |||
int diam = Math.Max (1, shapeWidt h - 2); | int diam = Math.Max (1, shapeWidt h - 2); | |||
Cairo.Rectangle shapeRect = new C airo.Rectangle (shapeX - halfOfShapeWidth, | Cairo.Rectangle shapeRect = new C airo.Rectangle (shapeX - halfOfShapeWidth, | |||
shapeY - halfOfShapeWidth, | shapeY - halfOfShapeWidth, | |||
diam, | diam, | |||
diam); | diam); | |||
Cairo.Color outerColor = new Cair o.Color (255, 255, 255, 0.75); | Cairo.Color outerColor = new Cair o.Color (255, 255, 255, 0.75); | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 2 lines changed or added |