mirror of
https://github.com/ShareX/ShareX.git
synced 2024-06-28 11:10:23 +12:00
Rename TrimInteriorTool to CutOutTool
This commit is contained in:
parent
b1f7441176
commit
d5f522ab80
|
@ -223,7 +223,7 @@ public static Bitmap CropBitmap(Bitmap bmp, Rectangle rect)
|
|||
return null;
|
||||
}
|
||||
|
||||
public static Bitmap TrimBitmapInteriorHorizontal(Bitmap bmp, int x, int width)
|
||||
public static Bitmap CutOutBitmapMiddleHorizontal(Bitmap bmp, int x, int width)
|
||||
{
|
||||
if (bmp != null && width > 0)
|
||||
{
|
||||
|
@ -255,7 +255,7 @@ public static Bitmap TrimBitmapInteriorHorizontal(Bitmap bmp, int x, int width)
|
|||
return null;
|
||||
}
|
||||
|
||||
public static Bitmap TrimBitmapInteriorVertical(Bitmap bmp, int y, int height)
|
||||
public static Bitmap CutOutBitmapMiddleVertical(Bitmap bmp, int y, int height)
|
||||
{
|
||||
if (bmp != null && height > 0)
|
||||
{
|
||||
|
|
|
@ -292,7 +292,7 @@ public enum ShapeType // Localized
|
|||
EffectPixelate,
|
||||
EffectHighlight,
|
||||
ToolCrop,
|
||||
ToolTrimInterior
|
||||
ToolCutOut
|
||||
}
|
||||
|
||||
public enum ScrollingCaptureScrollMethod // Localized
|
||||
|
|
|
@ -1195,8 +1195,8 @@ private BaseShape CreateShape(ShapeType shapeType)
|
|||
case ShapeType.ToolCrop:
|
||||
shape = new CropTool();
|
||||
break;
|
||||
case ShapeType.ToolTrimInterior:
|
||||
shape = new TrimInteriorTool();
|
||||
case ShapeType.ToolCutOut:
|
||||
shape = new CutOutTool();
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1820,7 +1820,7 @@ public Bitmap CropImage(RectangleF rect, bool onlyIfSizeDifferent = false)
|
|||
return null;
|
||||
}
|
||||
|
||||
public void TrimInterior(RectangleF rect)
|
||||
public void CutOut(RectangleF rect)
|
||||
{
|
||||
bool isHorizontal = rect.Width > rect.Height;
|
||||
|
||||
|
@ -1833,12 +1833,12 @@ public void TrimInterior(RectangleF rect)
|
|||
if (isHorizontal && cropRect.Width > 0)
|
||||
{
|
||||
CollapseAllHorizontal(rect.X, rect.Width);
|
||||
UpdateCanvas(ImageHelpers.TrimBitmapInteriorHorizontal(Form.Canvas, cropRect.X, cropRect.Width));
|
||||
UpdateCanvas(ImageHelpers.CutOutBitmapMiddleHorizontal(Form.Canvas, cropRect.X, cropRect.Width));
|
||||
}
|
||||
else if (!isHorizontal && cropRect.Height > 0)
|
||||
{
|
||||
CollapseAllVertical(rect.Y, rect.Height);
|
||||
UpdateCanvas(ImageHelpers.TrimBitmapInteriorVertical(Form.Canvas, cropRect.Y, cropRect.Height));
|
||||
UpdateCanvas(ImageHelpers.CutOutBitmapMiddleVertical(Form.Canvas, cropRect.Y, cropRect.Height));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -29,9 +29,9 @@
|
|||
|
||||
namespace ShareX.ScreenCaptureLib
|
||||
{
|
||||
public class TrimInteriorTool : BaseTool
|
||||
public class CutOutTool : BaseTool
|
||||
{
|
||||
public override ShapeType ShapeType { get; } = ShapeType.ToolTrimInterior;
|
||||
public override ShapeType ShapeType { get; } = ShapeType.ToolCutOut;
|
||||
|
||||
public override bool LimitRectangleToInsideCanvas { get; } = true;
|
||||
|
||||
|
@ -112,7 +112,7 @@ public override void OnCreated()
|
|||
|
||||
private void ConfirmButton_MousePressed(object sender, MouseEventArgs e)
|
||||
{
|
||||
Manager.TrimInterior(Rectangle);
|
||||
Manager.CutOut(Rectangle);
|
||||
Remove();
|
||||
}
|
||||
|
|
@ -226,7 +226,7 @@
|
|||
<Compile Include="Animations\TextAnimation.cs" />
|
||||
<Compile Include="RegionHelpers\WindowsList.cs" />
|
||||
<Compile Include="RegionHelpers\WindowsRectangleList.cs" />
|
||||
<Compile Include="Shapes\Tool\TrimInteriorTool.cs" />
|
||||
<Compile Include="Shapes\Tool\CutOutTool.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\ShareX.HelpersLib\ShareX.HelpersLib.csproj">
|
||||
|
|
Loading…
Reference in a new issue