add:定时恢复墨迹设置
This commit is contained in:
@@ -495,11 +495,6 @@ namespace Ink_Canvas
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (inkCanvas.EditingMode != InkCanvasEditingMode.Ink)
|
|
||||||
{
|
|
||||||
PenIcon_Click(null, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (drawingAttributes == null)
|
if (drawingAttributes == null)
|
||||||
{
|
{
|
||||||
drawingAttributes = inkCanvas.DefaultDrawingAttributes;
|
drawingAttributes = inkCanvas.DefaultDrawingAttributes;
|
||||||
@@ -533,7 +528,6 @@ namespace Ink_Canvas
|
|||||||
drawingAttributes.Color = colorWithAlpha;
|
drawingAttributes.Color = colorWithAlpha;
|
||||||
inkCanvas.DefaultDrawingAttributes.Color = colorWithAlpha;
|
inkCanvas.DefaultDrawingAttributes.Color = colorWithAlpha;
|
||||||
|
|
||||||
ColorSwitchCheck(false);
|
|
||||||
CheckColorTheme();
|
CheckColorTheme();
|
||||||
|
|
||||||
Ink_DefaultColor = inkCanvas.DefaultDrawingAttributes.Color;
|
Ink_DefaultColor = inkCanvas.DefaultDrawingAttributes.Color;
|
||||||
@@ -566,11 +560,10 @@ namespace Ink_Canvas
|
|||||||
inkCanvas.DefaultDrawingAttributes.Height = height;
|
inkCanvas.DefaultDrawingAttributes.Height = height;
|
||||||
}
|
}
|
||||||
|
|
||||||
LogHelper.WriteLogToFile($"SetBrushAttributesDirectly: 索引 currentMode=0=>{lastDesktopInkColor} 1=>{lastBoardInkColor}, 宽度={width}, 透明度={color.A}", LogHelper.LogType.Trace);
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
LogHelper.WriteLogToFile($"SetBrushAttributesDirectly 出错: {ex}", LogHelper.LogType.Warning);
|
LogHelper.WriteLogToFile($"SetBrushAttributesDirectly: {ex.Message}", LogHelper.LogType.Error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -649,10 +642,7 @@ namespace Ink_Canvas
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch { }
|
||||||
{
|
|
||||||
LogHelper.WriteLogToFile($"根据时间点计算画笔自动恢复时间间隔时出错: {ex}", LogHelper.LogType.Warning);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!nextInterval.HasValue)
|
if (!nextInterval.HasValue)
|
||||||
{
|
{
|
||||||
@@ -687,7 +677,7 @@ namespace Ink_Canvas
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
LogHelper.WriteLogToFile($"ScheduleBrushAutoRestore 出错: {ex}", LogHelper.LogType.Warning);
|
LogHelper.WriteLogToFile($"ScheduleBrushAutoRestore: {ex.Message}", LogHelper.LogType.Error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -727,17 +717,12 @@ namespace Ink_Canvas
|
|||||||
|
|
||||||
SetBrushAttributesDirectly(targetColor, width, width);
|
SetBrushAttributesDirectly(targetColor, width, width);
|
||||||
|
|
||||||
var actualColor = inkCanvas.DefaultDrawingAttributes.Color;
|
|
||||||
var actualWidth = inkCanvas.DefaultDrawingAttributes.Width;
|
|
||||||
var actualHeight = inkCanvas.DefaultDrawingAttributes.Height;
|
|
||||||
LogHelper.WriteLogToFile($"画笔自动恢复已应用: 目标颜色={targetColor}, 目标粗细={width}, 目标透明度={alphaConfig}", LogHelper.LogType.Event);
|
|
||||||
LogHelper.WriteLogToFile($"画笔自动恢复验证: 实际颜色={actualColor}, 实际粗细={actualWidth}, 实际高度={actualHeight}", LogHelper.LogType.Event);
|
|
||||||
UpdateBrushAutoRestoreTimerInterval();
|
UpdateBrushAutoRestoreTimerInterval();
|
||||||
_brushAutoRestoreTimer.Start();
|
_brushAutoRestoreTimer.Start();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
LogHelper.WriteLogToFile($"BrushAutoRestoreTimer_Tick 出错: {ex}", LogHelper.LogType.Warning);
|
LogHelper.WriteLogToFile($"BrushAutoRestoreTimer_Tick: {ex.Message}", LogHelper.LogType.Error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3060,10 +3045,14 @@ namespace Ink_Canvas
|
|||||||
|
|
||||||
Settings.Canvas.BrushAutoRestoreTimes = BrushAutoRestoreTimesTextBox.Text ?? string.Empty;
|
Settings.Canvas.BrushAutoRestoreTimes = BrushAutoRestoreTimesTextBox.Text ?? string.Empty;
|
||||||
SaveSettingsToFile();
|
SaveSettingsToFile();
|
||||||
|
if (Settings.Canvas.EnableBrushAutoRestore)
|
||||||
|
{
|
||||||
|
ScheduleBrushAutoRestore();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
LogHelper.WriteLogToFile($"更新画笔自动恢复时间点时出错: {ex.Message}", LogHelper.LogType.Error);
|
LogHelper.WriteLogToFile($"BrushAutoRestoreTimes: {ex.Message}", LogHelper.LogType.Error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -720,6 +720,15 @@ namespace Ink_Canvas
|
|||||||
InkWidthSlider.Value = Settings.Canvas.InkWidth * 2;
|
InkWidthSlider.Value = Settings.Canvas.InkWidth * 2;
|
||||||
HighlighterWidthSlider.Value = Settings.Canvas.HighlighterWidth;
|
HighlighterWidthSlider.Value = Settings.Canvas.HighlighterWidth;
|
||||||
|
|
||||||
|
int alpha = (int)Settings.Canvas.InkAlpha;
|
||||||
|
if (alpha < 0) alpha = 0; if (alpha > 255) alpha = 255;
|
||||||
|
var inkColor = drawingAttributes.Color;
|
||||||
|
drawingAttributes.Color = Color.FromArgb((byte)alpha, inkColor.R, inkColor.G, inkColor.B);
|
||||||
|
inkCanvas.DefaultDrawingAttributes.Color = drawingAttributes.Color;
|
||||||
|
if (InkAlphaSlider != null) InkAlphaSlider.Value = alpha;
|
||||||
|
if (BoardInkAlphaSlider != null) BoardInkAlphaSlider.Value = alpha;
|
||||||
|
|
||||||
|
|
||||||
ComboBoxHyperbolaAsymptoteOption.SelectedIndex = (int)Settings.Canvas.HyperbolaAsymptoteOption;
|
ComboBoxHyperbolaAsymptoteOption.SelectedIndex = (int)Settings.Canvas.HyperbolaAsymptoteOption;
|
||||||
|
|
||||||
if (Settings.Canvas.UsingWhiteboard)
|
if (Settings.Canvas.UsingWhiteboard)
|
||||||
|
|||||||
Reference in New Issue
Block a user