Skip to content

Commit c9d0296

Browse files
refactor: add comments
1 parent b37ec4f commit c9d0296

8 files changed

Lines changed: 11 additions & 17 deletions

File tree

FreeFrame/Components/Shapes/SVGLine.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
namespace FreeFrame.Components.Shapes
1111
{
12-
internal class SVGLine : Shape
12+
public class SVGLine : Shape
1313
{
1414
#region Default values
1515
const int DefaultX1 = 0;

FreeFrame/Components/Shapes/SVGPath.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
using System.Xml;
55
using System.Text.RegularExpressions;
66
using FreeFrame.Components.Shapes.Path;
7-
using DelaunatorSharp;
87
using OpenTK.Graphics.OpenGL4;
98
using OpenTK.Mathematics;
109

FreeFrame/Components/Shapes/Shape.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using FreeFrame.Components.Shapes.Path;
2-
using MathNet.Numerics.LinearAlgebra;
32
using Newtonsoft.Json;
43
using OpenTK.Graphics.OpenGL4;
54
using OpenTK.Mathematics;

FreeFrame/FreeFrame.csproj

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,19 @@
55
<TargetFramework>net6.0</TargetFramework>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
8+
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
89
</PropertyGroup>
910

1011
<ItemGroup>
1112
<PackageReference Include="AnimatedGif" Version="1.0.5" />
12-
<PackageReference Include="Delaunator" Version="1.0.9" />
1313
<PackageReference Include="Emgu.CV" Version="4.5.5.4823" />
1414
<PackageReference Include="Emgu.CV.Bitmap" Version="4.5.5.4823" />
1515
<PackageReference Include="Emgu.CV.runtime.ubuntu.20.04-x64" Version="4.5.5.4823" />
1616
<PackageReference Include="Emgu.CV.runtime.windows" Version="4.5.5.4823" />
17-
<PackageReference Include="GifMotion" Version="1.0.4" />
1817
<PackageReference Include="ImGui.NET" Version="1.87.3" />
19-
<PackageReference Include="MathNet.Numerics" Version="5.0.0" />
2018
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
2119
<PackageReference Include="OpenTK" Version="4.7.1" />
22-
<PackageReference Include="SixLabors.ImageSharp" Version="2.1.1" />
20+
<PackageReference Include="SixLabors.ImageSharp" Version="2.1.2" />
2321
<PackageReference Include="System.Drawing.Common" Version="6.0.0" />
2422
</ItemGroup>
2523

FreeFrame/Renderer.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using OpenTK.Graphics.OpenGL4;
2-
using MathNet.Numerics.LinearAlgebra;
32
using System;
43
using System.Collections.Generic;
54
using System.Linq;

FreeFrame/Shaders/rectangle.frag

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ uniform vec2 u_Position;
88
uniform vec2 u_Size;
99
uniform float u_Radius;
1010

11-
1211
float roundedBox(vec2 centerPosition, vec2 size, float rad) {
1312
return length(max(abs(centerPosition) - size + rad, 0.0)) - rad;
1413
}
14+
1515
void main() {
1616
// How soft the edges should be (in pixels). Higher values could be used to simulate a drop shadow.
17-
float edgeSoftness = 1.0f;
17+
float edgeSoftness = 0.5f;
1818

1919
// The radius of the corners (in pixels).
2020
float radius = clamp(u_Radius, 0.0f, min(u_Size.x, u_Size.y) / 2.0f);
@@ -25,7 +25,7 @@ void main() {
2525
float distance = roundedBox(gl_FragCoord.xy - position + vec2(-u_Size.x/2.0f, u_Size.y/2.0f), u_Size/2.0f, radius);
2626

2727
// Smooth the result (free antialiasing).
28-
float smoothedAlpha = 1.0f - smoothstep(0.0f, edgeSoftness * 2.0f, distance);
28+
float smoothedAlpha = 1.0f - smoothstep(0.0f, 1.0f, distance);
2929

3030
// Return the resultant shape.
3131
vec4 quadColor = vec4(u_Color.xyz, smoothedAlpha * u_Color.w);

FreeFrame/Window.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@
2020
using System.Runtime.Versioning;
2121
using Emgu.CV.Util;
2222
using Emgu.CV.Structure;
23-
using SixLabors.ImageSharp.PixelFormats;
24-
using SixLabors.ImageSharp;
25-
using SixLabors.ImageSharp.Processing;
2623
using AnimatedGif;
2724
using System.Drawing.Drawing2D;
2825
using System.Text.Json;
2926
using System.Text.Json.Serialization;
3027
using Newtonsoft.Json;
3128
using FreeFrame.Lib.FileExplorer;
29+
using SixLabors.ImageSharp.Advanced;
30+
using SixLabors.ImageSharp;
31+
using SixLabors.ImageSharp.PixelFormats;
3232

3333
namespace FreeFrame
3434
{
@@ -1198,7 +1198,7 @@ public void DuplicateShape(Shape shape)
11981198
Shape copy = shape.DeepCopy();
11991199
ResetSelection();
12001200
Shapes.Add(copy);
1201-
_selectedShape = copy;
1201+
copy.ImplementObject();
12021202
}
12031203

12041204
/// <summary>
@@ -1324,7 +1324,6 @@ public void RenderFrameBySecondIndex(int second)
13241324
shape.Draw(ClientSize);
13251325
}
13261326

1327-
// [SupportedOSPlatform("windows")]
13281327
/// <summary>
13291328
/// Take a screenshot of the current user view
13301329
/// </summary>

FreeFrameTests/FreeFrameTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<PackageReference Include="MSTest.TestAdapter" Version="2.2.7" />
1919
<PackageReference Include="MSTest.TestFramework" Version="2.2.7" />
2020
<PackageReference Include="coverlet.collector" Version="3.1.0" />
21-
<PackageReference Include="SixLabors.ImageSharp" Version="2.1.1" />
21+
<PackageReference Include="SixLabors.ImageSharp" Version="2.1.2" />
2222
</ItemGroup>
2323

2424
<ItemGroup>

0 commit comments

Comments
 (0)