PencilTool.cs (pinta-1.7) | : | PencilTool.cs (pinta-1.7.1) | ||
---|---|---|---|---|
skipping to change at line 134 | skipping to change at line 134 | |||
ImageSurface surf = doc.CurrentUserLayer.Surface; | ImageSurface surf = doc.CurrentUserLayer.Surface; | |||
using (Context g = new Context (surf)) { | using (Context g = new Context (surf)) { | |||
g.AppendPath (doc.Selection.SelectionPath); | g.AppendPath (doc.Selection.SelectionPath); | |||
g.FillRule = FillRule.EvenOdd; | g.FillRule = FillRule.EvenOdd; | |||
g.Clip (); | g.Clip (); | |||
g.Antialias = Antialias.None; | g.Antialias = Antialias.None; | |||
if (first_pixel) { | g.SetSourceColor(tool_color); | |||
if (UseAlphaBlending) | ||||
g.SetBlendMode(BlendMode.Normal); | ||||
else | ||||
g.Operator = Operator.Source; | ||||
g.LineWidth = 1; | ||||
g.LineCap = LineCap.Square; | ||||
if (first_pixel) { | ||||
// Cairo does not support a single-pixel- long single-pixel-wide line | // Cairo does not support a single-pixel- long single-pixel-wide line | |||
g.Rectangle (x, y, 1.0, 1.0); | g.Rectangle (x, y, 1.0, 1.0); | |||
g.Fill (); | g.Fill (); | |||
} else { | } else { | |||
// Adding 0.5 forces cairo into the corre ct square: | // Adding 0.5 forces cairo into the corre ct square: | |||
// See https://bugs.launchpad.net/bugs/67 2232 | // See https://bugs.launchpad.net/bugs/67 2232 | |||
g.MoveTo (last_point.X + 0.5, last_point. Y + 0.5); | g.MoveTo (last_point.X + 0.5, last_point. Y + 0.5); | |||
g.LineTo (x + 0.5, y + 0.5); | g.LineTo (x + 0.5, y + 0.5); | |||
g.Stroke(); | ||||
} | } | |||
g.SetSourceColor (tool_color); | ||||
if (UseAlphaBlending) | ||||
g.SetBlendMode(BlendMode.Normal); | ||||
else | ||||
g.Operator = Operator.Source; | ||||
g.LineWidth = 1; | ||||
g.LineCap = LineCap.Square; | ||||
g.Stroke (); | ||||
} | } | |||
Gdk.Rectangle r = GetRectangleFromPoints (last_point, new Point (x, y)); | Gdk.Rectangle r = GetRectangleFromPoints (last_point, new Point (x, y)); | |||
doc.Workspace.Invalidate (doc.ClampToImageSize (r)); | doc.Workspace.Invalidate (doc.ClampToImageSize (r)); | |||
last_point = new Point (x, y); | last_point = new Point (x, y); | |||
} | } | |||
protected override void OnMouseUp (Gtk.DrawingArea canvas, Gtk.Bu ttonReleaseEventArgs args, Cairo.PointD point) | protected override void OnMouseUp (Gtk.DrawingArea canvas, Gtk.Bu ttonReleaseEventArgs args, Cairo.PointD point) | |||
End of changes. 3 change blocks. | ||||
11 lines changed or deleted | 10 lines changed or added |