mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-01 17:56:51 +13:00
Removed random position option from image watermark because random images effect can be used for same purpose
This commit is contained in:
parent
9bcd554c43
commit
bbbbbc3ccb
1 changed files with 1 additions and 24 deletions
|
@ -43,9 +43,6 @@ public class DrawImage : ImageEffect
|
|||
[DefaultValue(typeof(Point), "5, 5")]
|
||||
public Point Offset { get; set; }
|
||||
|
||||
[DefaultValue(false)]
|
||||
public bool RandomPosition { get; set; }
|
||||
|
||||
[DefaultValue(DrawImageSizeMode.DontResize), Description("How the image watermark should be rescaled, if at all.")]
|
||||
public DrawImageSizeMode SizeMode { get; set; }
|
||||
|
||||
|
@ -87,27 +84,7 @@ public override Image Apply(Image img)
|
|||
}
|
||||
|
||||
// Place the image
|
||||
Point imagePosition;
|
||||
if (RandomPosition)
|
||||
{
|
||||
int x = 0;
|
||||
if (img.Width - imageSize.Width > 0)
|
||||
{
|
||||
x = MathHelpers.Random(0, img.Width - imageSize.Width);
|
||||
}
|
||||
|
||||
int y = 0;
|
||||
if (img.Height - imageSize.Height > 0)
|
||||
{
|
||||
y = MathHelpers.Random(0, img.Height - imageSize.Height);
|
||||
}
|
||||
|
||||
imagePosition = new Point(x, y);
|
||||
}
|
||||
else
|
||||
{
|
||||
imagePosition = Helpers.GetPosition(Placement, Offset, img.Size, imageSize);
|
||||
}
|
||||
Point imagePosition = Helpers.GetPosition(Placement, Offset, img.Size, imageSize);
|
||||
|
||||
Rectangle imageRectangle = new Rectangle(imagePosition, imageSize);
|
||||
|
||||
|
|
Loading…
Reference in a new issue