Skip to content

Commit

Permalink
*截图 优化细节
Browse files Browse the repository at this point in the history
  • Loading branch information
MakesYT committed Jan 11, 2025
1 parent 2498926 commit 5e1a0af
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 26 deletions.
4 changes: 2 additions & 2 deletions Core.Window/ScreenCapture/CaptureTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ public static unsafe byte[] GetBytesSpan(MappedSubresource mappedSubresource, Ou
outputDesc.WhitePoint[1]
],
[
.640f, .330f, .300f, .600f, .150f, .060f, outputDesc.WhitePoint[0],
outputDesc.WhitePoint[1]
.640f, .330f, .300f, .600f, .150f, .060f, .3127f,
.3290f
]
);
var span = new ReadOnlySpan<Half>(mappedSubresource.PData,
Expand Down
12 changes: 5 additions & 7 deletions Core/SDKs/CustomScenario/CustomScenario.cs
Original file line number Diff line number Diff line change
Expand Up @@ -487,13 +487,11 @@ private void ParsePointItem(Dictionary<ScenarioMethodNode, Thread?> threads,
catch (Exception e)
{
Log.Error("错误",e);
if (e.InnerException is not null)
{
((IToastService)ServiceManager.Services.GetService(typeof(IToastService))!).Show("情景",
$"情景{Name}出现错误\n{e.InnerException?.Message}");
}else ((IToastService)ServiceManager.Services.GetService(typeof(IToastService))!).Show("情景",
$"情景{Name}出现错误\n{e.Message}");

((IToastService)ServiceManager.Services.GetService(typeof(IToastService))!).Show("情景",
e.InnerException is not null
? $"情景{Name}出现错误\n{e.InnerException?.Message}"
: $"情景{Name}出现错误\n{e.Message}");

Task.Run(() => { Stop(true); });

valid = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,11 +300,9 @@ private void UpdatePointerOnResizeSizeBoxBorder(Point position)

private void UpdateCursor(string cursor)
{
if (!Cursor.ToString().Equals(cursor))
{
Cursor?.Dispose();
Cursor = new Cursor(Enum.Parse<StandardCursorType>(cursor));
}
if (Cursor == null || Cursor.ToString().Equals(cursor)) return;
Cursor?.Dispose();
Cursor = new Cursor(Enum.Parse<StandardCursorType>(cursor));
}

#endregion
Expand Down
1 change: 1 addition & 0 deletions KitopiaAvalonia/Windows/MainWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
xmlns:controls="clr-namespace:KitopiaAvalonia.Controls"
xmlns:converter="clr-namespace:KitopiaAvalonia.Converter"
Icon="/Assets/icon.png"
WindowState="Minimized"
IsTitleBarVisible="True"
Title="Kitopia">

Expand Down
4 changes: 1 addition & 3 deletions KitopiaAvalonia/Windows/ScreenCaptureWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,7 @@

</Border>


<Line ZIndex="2" Name="X" Fill="WhiteSmoke" Stroke="WhiteSmoke" StrokeThickness="1.5" IsVisible="False" />
<Line ZIndex="2" Name="Y" Fill="WhiteSmoke" Stroke="WhiteSmoke" StrokeThickness="1.5" IsVisible="False" />


</Canvas>
</Window>
10 changes: 1 addition & 9 deletions KitopiaAvalonia/Windows/ScreenCaptureWindow.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,6 @@ protected override void OnPointerPressed(PointerPressedEventArgs e)
.Properties.IsLeftButtonPressed && !IsSelected)
{
Selecting = true;
X.IsVisible = false;
Y.IsVisible = false;
SelectBox.IsVisible = true;
Cursor?.Dispose();
Cursor = new Cursor(StandardCursorType.BottomRightCorner);
Expand Down Expand Up @@ -259,8 +257,6 @@ protected override void OnPointerExited(PointerEventArgs e)
{
base.OnPointerExited(e);
PointerOver = false;
X.IsVisible = false;
Y.IsVisible = false;
}

protected override void OnPointerMoved(PointerEventArgs e)
Expand Down Expand Up @@ -338,11 +334,6 @@ protected override void OnPointerMoved(PointerEventArgs e)
SelectBox.IsVisible = true;
UpdateSelectBox();
}
else
{
X.IsVisible = false;
Y.IsVisible = false;
}
}

public 截图工具 NowTool = 截图工具.;
Expand Down Expand Up @@ -784,6 +775,7 @@ private void UpdateSelectBox()
GeometryCombineMode = GeometryCombineMode.Exclude
};
Rectangle.Clip = combinedGeometry;
Rectangle.InvalidateVisual();
}

private void UpdateToolBar()
Expand Down

0 comments on commit 5e1a0af

Please sign in to comment.