Code cleanup

This commit is contained in:
Stone_Red
2026-06-10 03:22:45 +02:00
parent f6e03c052e
commit 3a635e85df
6 changed files with 11 additions and 23 deletions
-4
View File
@@ -2,13 +2,9 @@ global using Sys = Cosmos.Kernel.System;
using RemSox.Processes; using RemSox.Processes;
using RemSox.Processing; using RemSox.Processing;
using RemSox.Processing.IPC;
using RemSox.UI.CLI; using RemSox.UI.CLI;
using RemSox.UI.CLI.Commands; using RemSox.UI.CLI.Commands;
using RemSox.UI.GUI.UIEelements.Shapes;
using RemSox.UI.GUI.Windows;
using System.Drawing;
using System.Runtime; using System.Runtime;
namespace RemSox; namespace RemSox;
+2
View File
@@ -54,7 +54,9 @@ internal class CliProcess() : Process("Cli")
private static void HandleCommand(string input) private static void HandleCommand(string input)
{ {
if (string.IsNullOrWhiteSpace(input)) if (string.IsNullOrWhiteSpace(input))
{
return; return;
}
bool handled = CommandManager.TryExecute( bool handled = CommandManager.TryExecute(
input, input,
+2 -5
View File
@@ -1,13 +1,10 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Threading.Tasks;
using RemSox.Processing; using RemSox.Processing;
using RemSox.Processing.IPC; using RemSox.Processing.IPC;
using RemSox.UI.GUI.UIEelements.Shapes; using RemSox.UI.GUI.UIEelements.Shapes;
using RemSox.UI.GUI.Windows; using RemSox.UI.GUI.Windows;
using System.Drawing;
namespace RemSox.Processes; namespace RemSox.Processes;
public class TestProcess() : Process("Test Process") public class TestProcess() : Process("Test Process")
+1 -1
View File
@@ -180,7 +180,7 @@ public static class ProcessManager
int tickTimeMs = (int)stopwatch.ElapsedMilliseconds; int tickTimeMs = (int)stopwatch.ElapsedMilliseconds;
entry.Metrics.LastTickTimeMs = tickTimeMs; entry.Metrics.LastTickTimeMs = tickTimeMs;
entry.Metrics.AverageTickTimeMs = (entry.Metrics.AverageTickTimeMs * 7 + tickTimeMs) / 8; entry.Metrics.AverageTickTimeMs = ((entry.Metrics.AverageTickTimeMs * 7) + tickTimeMs) / 8;
} }
else else
{ {
+4 -10
View File
@@ -1,14 +1,8 @@
using System; namespace RemSox.Processing;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace RemSox.Processing public class ProcessMetrics
{ {
public class ProcessMetrics public int AverageTickTimeMs { get; set; }
{
public int AverageTickTimeMs { get; set; }
public int LastTickTimeMs { get; set; } public int LastTickTimeMs { get; set; }
}
} }
+2 -3
View File
@@ -1,4 +1,3 @@
using Cosmos.Kernel.System.Graphics;
using RemSox.UI.GUI.Rendering; using RemSox.UI.GUI.Rendering;
using RemSox.UI.GUI.UIEelements; using RemSox.UI.GUI.UIEelements;
@@ -335,14 +334,14 @@ public sealed class Window(string title, int processId, int id, IRenderSource re
int maxDx = interactionStartBounds.Width - minWidth; int maxDx = interactionStartBounds.Width - minWidth;
int clampedDx = Math.Min(dx, maxDx); int clampedDx = Math.Min(dx, maxDx);
newX = Math.Max(0, interactionStartBounds.X + clampedDx); newX = Math.Max(0, interactionStartBounds.X + clampedDx);
newW = (interactionStartBounds.X + interactionStartBounds.Width) - newX; newW = interactionStartBounds.X + interactionStartBounds.Width - newX;
} }
if (currentInteraction is InteractionMode.ResizeTop or InteractionMode.ResizeTopLeft or InteractionMode.ResizeTopRight) if (currentInteraction is InteractionMode.ResizeTop or InteractionMode.ResizeTopLeft or InteractionMode.ResizeTopRight)
{ {
int maxDy = interactionStartBounds.Height - minHeight; int maxDy = interactionStartBounds.Height - minHeight;
int clampedDy = Math.Min(dy, maxDy); int clampedDy = Math.Min(dy, maxDy);
newY = Math.Max(0, interactionStartBounds.Y + clampedDy); newY = Math.Max(0, interactionStartBounds.Y + clampedDy);
newH = (interactionStartBounds.Y + interactionStartBounds.Height) - newY; newH = interactionStartBounds.Y + interactionStartBounds.Height - newY;
} }
Position = new Point(newX, newY); Position = new Point(newX, newY);