This commit is contained in:
2025-10-01 00:49:12 +08:00
parent 46b064b0a8
commit 07a62d2f78
18 changed files with 229 additions and 52 deletions
@@ -1493,7 +1493,7 @@ namespace Ink_Canvas
#region Image Resize Handles
// 图片缩放选择点相关变量
private bool isResizingImage = false;
private bool isResizingImage;
private Point imageResizeStartPoint;
private string activeResizeHandle = "";
+5 -5
View File
@@ -13,14 +13,14 @@ namespace Ink_Canvas
public partial class MainWindow : Window
{
// 橡皮擦系统核心变量
public bool isUsingGeometryEraser = false;
private IncrementalStrokeHitTester hitTester = null;
public bool isUsingGeometryEraser;
private IncrementalStrokeHitTester hitTester;
public double eraserWidth = 64;
public bool isEraserCircleShape = false;
public bool isUsingStrokesEraser = false;
public bool isEraserCircleShape;
public bool isUsingStrokesEraser;
private Matrix scaleMatrix = new Matrix();
private Matrix scaleMatrix;
// 橡皮擦覆盖层相关控件
private System.Windows.Controls.Canvas eraserOverlayCanvas;
+2 -2
View File
@@ -91,8 +91,8 @@ namespace Ink_Canvas
private const int ProcessMonitorInterval = 1000; // 应用程序监控间隔(毫秒)
// 上次播放位置相关字段
private int _lastPlaybackPage = 0;
private bool _shouldNavigateToLastPage = false;
private int _lastPlaybackPage;
private bool _shouldNavigateToLastPage;
// 页面切换防抖机制
private DateTime _lastSlideSwitchTime = DateTime.MinValue;
@@ -255,12 +255,12 @@ namespace Ink_Canvas
#endregion
private bool isGridInkCanvasSelectionCoverMouseDown;
private bool isStrokeDragging = false;
private bool isStrokeDragging;
private Point strokeDragStartPoint;
private StrokeCollection StrokesSelectionClone = new StrokeCollection();
// 选择框和选择点相关变量
private bool isResizing = false;
private bool isResizing;
private string currentResizeHandle = "";
private Point resizeStartPoint;
private Rect originalSelectionBounds;
+38
View File
@@ -2516,6 +2516,44 @@ namespace Ink_Canvas
SaveSettingsToFile();
}
private void ToggleSwitchUseLegacyTimerUI_Toggled(object sender, RoutedEventArgs e)
{
if (!isLoaded) return;
Settings.RandSettings.UseLegacyTimerUI = ToggleSwitchUseLegacyTimerUI.IsOn;
SaveSettingsToFile();
}
private void TimerVolumeSlider_ValueChanged(object sender, RoutedEventArgs e)
{
if (!isLoaded) return;
Settings.RandSettings.TimerVolume = TimerVolumeSlider.Value;
SaveSettingsToFile();
}
private void ButtonSelectCustomTimerSound_Click(object sender, RoutedEventArgs e)
{
Microsoft.Win32.OpenFileDialog openFileDialog = new Microsoft.Win32.OpenFileDialog
{
Title = "选择计时器提醒铃声",
Filter = "音频文件 (*.wav)|*.wav|所有文件 (*.*)|*.*",
DefaultExt = "wav"
};
if (openFileDialog.ShowDialog() == true)
{
Settings.RandSettings.CustomTimerSoundPath = openFileDialog.FileName;
SaveSettingsToFile();
MessageBox.Show("自定义铃声设置成功!", "设置成功", MessageBoxButton.OK, MessageBoxImage.Information);
}
}
private void ButtonResetTimerSound_Click(object sender, RoutedEventArgs e)
{
Settings.RandSettings.CustomTimerSoundPath = "";
SaveSettingsToFile();
MessageBox.Show("已重置为默认铃声!", "重置成功", MessageBoxButton.OK, MessageBoxImage.Information);
}
private void ToggleSwitchShowRandomAndSingleDraw_Toggled(object sender, RoutedEventArgs e)
{
if (!isLoaded) return;
@@ -856,6 +856,10 @@ namespace Ink_Canvas
RandomDrawPanel.Visibility = Settings.RandSettings.ShowRandomAndSingleDraw ? Visibility.Visible : Visibility.Collapsed;
SingleDrawPanel.Visibility = Settings.RandSettings.ShowRandomAndSingleDraw ? Visibility.Visible : Visibility.Collapsed;
// 计时器设置
ToggleSwitchUseLegacyTimerUI.IsOn = Settings.RandSettings.UseLegacyTimerUI;
TimerVolumeSlider.Value = Settings.RandSettings.TimerVolume;
// 加载自定义点名背景
UpdatePickNameBackgroundsInComboBox();
@@ -874,6 +878,8 @@ namespace Ink_Canvas
RandWindowOnceMaxStudentsSlider.Value = Settings.RandSettings.RandWindowOnceMaxStudents;
ToggleSwitchExternalCaller.IsOn = Settings.RandSettings.DirectCallCiRand;
ComboBoxExternalCallerType.SelectedIndex = Settings.RandSettings.ExternalCallerType;
ToggleSwitchUseLegacyTimerUI.IsOn = Settings.RandSettings.UseLegacyTimerUI;
TimerVolumeSlider.Value = Settings.RandSettings.TimerVolume;
}
// ModeSettings
+2 -2
View File
@@ -71,10 +71,10 @@ namespace Ink_Canvas
private DateTime cachedNetworkTime = DateTime.Now;
private DateTime lastNtpSyncTime = DateTime.MinValue;
private string lastDisplayedTime = "";
private bool useNetworkTime = false;
private bool useNetworkTime;
private TimeSpan networkTimeOffset = TimeSpan.Zero;
private DateTime lastLocalTime = DateTime.Now; // 记录上次的本地时间,用于检测时间跳跃
private bool isNtpSyncing = false; // 防止重复NTP同步的标志
private bool isNtpSyncing; // 防止重复NTP同步的标志
private async Task<DateTime> GetNetworkTimeAsync()
{
+1 -2
View File
@@ -24,8 +24,7 @@ namespace Ink_Canvas
private InkCanvasEditingMode lastInkCanvasEditingMode = InkCanvasEditingMode.Ink;
private DateTime lastTouchDownTime = DateTime.MinValue;
private const double MULTI_TOUCH_DELAY_MS = 100;
private bool isInWritingMode = false;
private bool isMultiTouchTimerActive = false;
private bool isMultiTouchTimerActive;
/// </summary>
/// 保存画布上的非笔画元素(如图片、媒体元素等)