mirror of
https://github.com/greenshot/greenshot
synced 2025-08-19 21:13:23 -07:00
Small fixes in GraphicsPath usage, making sure they are disposed. Also making sure Anti-Aliasing is used when drawing the shadow.
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1644 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
5aa6249231
commit
8374aa5fb6
7 changed files with 100 additions and 78 deletions
|
@ -102,11 +102,12 @@ namespace Greenshot.Drawing {
|
|||
using (Pen pen = new Pen(Color.White)) {
|
||||
pen.Width = lineThickness;
|
||||
SetArrowHeads((ArrowHeadCombination)GetFieldValue(FieldType.ARROWHEADS), pen);
|
||||
GraphicsPath path = new GraphicsPath();
|
||||
path.AddLine(this.Left, this.Top, this.Left + this.Width, this.Top + this.Height);
|
||||
Rectangle drawingBounds = Rectangle.Round(path.GetBounds(new Matrix(), pen));
|
||||
drawingBounds.Inflate(2,2);
|
||||
return drawingBounds;
|
||||
using (GraphicsPath path = new GraphicsPath()) {
|
||||
path.AddLine(this.Left, this.Top, this.Left + this.Width, this.Top + this.Height);
|
||||
Rectangle drawingBounds = Rectangle.Round(path.GetBounds(new Matrix(), pen));
|
||||
drawingBounds.Inflate(2, 2);
|
||||
return drawingBounds;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return Rectangle.Empty;
|
||||
|
@ -120,9 +121,10 @@ namespace Greenshot.Drawing {
|
|||
using (Pen pen = new Pen(Color.White)) {
|
||||
pen.Width = lineThickness;
|
||||
SetArrowHeads((ArrowHeadCombination)GetFieldValue(FieldType.ARROWHEADS), pen);
|
||||
GraphicsPath path = new GraphicsPath();
|
||||
path.AddLine(this.Left, this.Top, this.Left + this.Width, this.Top + this.Height);
|
||||
return path.IsOutlineVisible(x,y, pen);
|
||||
using (GraphicsPath path = new GraphicsPath()) {
|
||||
path.AddLine(this.Left, this.Top, this.Left + this.Width, this.Top + this.Height);
|
||||
return path.IsOutlineVisible(x, y, pen);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue