mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-01 09:47:22 +13:00
CodeFactor refactors
This commit is contained in:
parent
61553ecd38
commit
74d57ccc12
4 changed files with 4 additions and 5 deletions
|
@ -80,7 +80,7 @@ public bool CheckClipboard()
|
||||||
{
|
{
|
||||||
colorPicker.ChangeColor(clipboardColor);
|
colorPicker.ChangeColor(clipboardColor);
|
||||||
btnClipboardStatus.Text = "Clipboard: " + text;
|
btnClipboardStatus.Text = "Clipboard: " + text;
|
||||||
btnClipboardStatus.Location = new Point(btnClipboardColorPicker.Left + btnClipboardColorPicker.Width / 2 - btnClipboardStatus.Width / 2,
|
btnClipboardStatus.Location = new Point(btnClipboardColorPicker.Left + (btnClipboardColorPicker.Width / 2) - (btnClipboardStatus.Width / 2),
|
||||||
btnClipboardColorPicker.Top - btnClipboardStatus.Height - 5);
|
btnClipboardColorPicker.Top - btnClipboardStatus.Height - 5);
|
||||||
clipboardStatusHider.Show();
|
clipboardStatusHider.Show();
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -296,7 +296,7 @@ public static Bitmap BuildImage(byte[] sourceData, int width, int height, int st
|
||||||
int targetStride = targetData.Stride;
|
int targetStride = targetData.Stride;
|
||||||
long scan0 = targetData.Scan0.ToInt64();
|
long scan0 = targetData.Scan0.ToInt64();
|
||||||
for (int y = 0; y < height; y++)
|
for (int y = 0; y < height; y++)
|
||||||
Marshal.Copy(sourceData, y * stride, new IntPtr(scan0 + y * targetStride), newDataWidth);
|
Marshal.Copy(sourceData, y * stride, new IntPtr(scan0 + (y * targetStride)), newDataWidth);
|
||||||
newImage.UnlockBits(targetData);
|
newImage.UnlockBits(targetData);
|
||||||
// Fix negative stride on BMP format.
|
// Fix negative stride on BMP format.
|
||||||
if (isFlipped)
|
if (isFlipped)
|
||||||
|
|
|
@ -551,7 +551,7 @@ private static float DistanceToThreshold(UnsafeBitmap unsafeBitmap, int x, int y
|
||||||
int maxx = Math.Min(x + radius, unsafeBitmap.Width - 1);
|
int maxx = Math.Min(x + radius, unsafeBitmap.Width - 1);
|
||||||
int miny = Math.Max(y - radius, 0);
|
int miny = Math.Max(y - radius, 0);
|
||||||
int maxy = Math.Min(y + radius, unsafeBitmap.Height - 1);
|
int maxy = Math.Min(y + radius, unsafeBitmap.Height - 1);
|
||||||
int dist2 = radius * radius + 1;
|
int dist2 = (radius * radius) + 1;
|
||||||
|
|
||||||
for (int tx = minx; tx <= maxx; tx++)
|
for (int tx = minx; tx <= maxx; tx++)
|
||||||
{
|
{
|
||||||
|
@ -563,7 +563,7 @@ private static float DistanceToThreshold(UnsafeBitmap unsafeBitmap, int x, int y
|
||||||
{
|
{
|
||||||
int dx = tx - x;
|
int dx = tx - x;
|
||||||
int dy = ty - y;
|
int dy = ty - y;
|
||||||
int test_dist2 = dx * dx + dy * dy;
|
int test_dist2 = (dx * dx) + (dy * dy);
|
||||||
if (test_dist2 < dist2)
|
if (test_dist2 < dist2)
|
||||||
{
|
{
|
||||||
dist2 = test_dist2;
|
dist2 = test_dist2;
|
||||||
|
|
|
@ -52,7 +52,6 @@ public object GetValue(object target)
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
|
|
Loading…
Reference in a new issue