mirror of
https://github.com/greenshot/greenshot
synced 2025-07-16 10:03:44 -07:00
Moving back to trunk!
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1602 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
ad265b2c54
commit
8d458998a1
332 changed files with 17647 additions and 9466 deletions
|
@ -20,10 +20,7 @@
|
|||
*/
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Windows.Forms;
|
||||
|
||||
using Greenshot.Configuration;
|
||||
using System.Drawing.Drawing2D;
|
||||
using Greenshot.Drawing.Fields;
|
||||
using Greenshot.Helpers;
|
||||
using Greenshot.Plugin.Drawing;
|
||||
|
@ -40,7 +37,7 @@ namespace Greenshot.Drawing {
|
|||
AddField(GetType(), FieldType.LINE_THICKNESS, 2);
|
||||
AddField(GetType(), FieldType.LINE_COLOR, Color.Red);
|
||||
AddField(GetType(), FieldType.FILL_COLOR, Color.Transparent);
|
||||
AddField(GetType(), FieldType.SHADOW, false);
|
||||
AddField(GetType(), FieldType.SHADOW, true);
|
||||
}
|
||||
|
||||
|
||||
|
@ -73,8 +70,10 @@ namespace Greenshot.Drawing {
|
|||
|
||||
Rectangle rect = GuiRectangle.GetGuiRectangle(this.Left, this.Top, this.Width, this.Height);
|
||||
|
||||
using (Brush brush = new SolidBrush(fillColor)) {
|
||||
g.FillRectangle(brush, rect);
|
||||
if (!Color.Transparent.Equals(fillColor)) {
|
||||
using (Brush brush = new SolidBrush(fillColor)) {
|
||||
g.FillRectangle(brush, rect);
|
||||
}
|
||||
}
|
||||
|
||||
if (lineThickness > 0) {
|
||||
|
@ -85,5 +84,29 @@ namespace Greenshot.Drawing {
|
|||
}
|
||||
}
|
||||
|
||||
public override bool ClickableAt(int x, int y) {
|
||||
Rectangle rect = GuiRectangle.GetGuiRectangle(this.Left, this.Top, this.Width, this.Height);
|
||||
int lineThickness = GetFieldValueAsInt(FieldType.LINE_THICKNESS) + 10;
|
||||
Color fillColor = GetFieldValueAsColor(FieldType.FILL_COLOR);
|
||||
|
||||
// If we clicked inside the rectangle and it's visible we are clickable at.
|
||||
if (!Color.Transparent.Equals(fillColor)) {
|
||||
if (rect.Contains(x,y)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// check the rest of the lines
|
||||
if (lineThickness > 0) {
|
||||
using (Pen pen = new Pen(Color.White)) {
|
||||
pen.Width = lineThickness;
|
||||
GraphicsPath path = new GraphicsPath();
|
||||
path.AddRectangle(rect);
|
||||
return path.IsOutlineVisible(x, y, pen);
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue