From ea778ee51c49e9ee5153f491356dad5febf87eba Mon Sep 17 00:00:00 2001
From: Gaiatux <82941631+Gaiatux@users.noreply.github.com>
Date: Thu, 27 May 2021 00:16:10 +0200
Subject: [PATCH] LiveDraw-0.1.2 (#16)
Add button to Switch between Line and brush mode
---
LiveDraw/MainWindow.xaml | 7 +++++++
LiveDraw/MainWindow.xaml.cs | 7 +++++++
2 files changed, 14 insertions(+)
diff --git a/LiveDraw/MainWindow.xaml b/LiveDraw/MainWindow.xaml
index 5cf7d98..c9c7a1b 100644
--- a/LiveDraw/MainWindow.xaml
+++ b/LiveDraw/MainWindow.xaml
@@ -230,6 +230,13 @@
+
+
+
+
+
+
+
diff --git a/LiveDraw/MainWindow.xaml.cs b/LiveDraw/MainWindow.xaml.cs
index 30d0cc6..b42c10b 100644
--- a/LiveDraw/MainWindow.xaml.cs
+++ b/LiveDraw/MainWindow.xaml.cs
@@ -180,6 +180,7 @@ private void SetEnable(bool b)
//SetTopMost(false);
if (_enable == true)
{
+ LineButton.IsActived = false;
SetStaticInfo("LiveDraw");
MainInkCanvas.EditingMode = InkCanvasEditingMode.Ink;
}
@@ -210,6 +211,7 @@ private void SetBrushSize(double s)
MainInkCanvas.DefaultDrawingAttributes.Width = s;
brushPreview?.BeginAnimation(HeightProperty, new DoubleAnimation(s, Duration4));
brushPreview?.BeginAnimation(WidthProperty, new DoubleAnimation(s, Duration4));
+ MainInkCanvas.EraserShape = new EllipseStylusShape(s,s);
}
private void SetEraserMode(bool v)
{
@@ -499,6 +501,10 @@ private void BrushSwitchButton_Click(object sender, RoutedEventArgs e)
if (_brushIndex > _brushSizes.Count() - 1) _brushIndex = 0;
SetBrushSize(_brushSizes[_brushIndex]);
}
+ private void LineButton_Click(object sender, RoutedEventArgs e)
+ {
+ LineMode(!_lineMode);
+ }
private void UndoButton_Click(object sender, RoutedEventArgs e)
{
Undo();
@@ -789,6 +795,7 @@ private void Window_KeyDown(object sender, KeyEventArgs e)
private void LineMode(bool l)
{
+ LineButton.IsActived = l;
_lineMode = l;
if (_lineMode)
{