diff --git a/CampusPulugin/CanvasWindow.xaml.cs b/CampusPulugin/CanvasWindow.xaml.cs index 2f3e513..1acde6a 100644 --- a/CampusPulugin/CanvasWindow.xaml.cs +++ b/CampusPulugin/CanvasWindow.xaml.cs @@ -1,4 +1,4 @@ -using System.Windows.Controls; +using System.Windows.Controls; using System.Windows; using Microsoft.Win32; using System.Windows.Media.Imaging; @@ -225,7 +225,6 @@ private void ShowTextEditorModal(Border border) bool initialIsItalic = textBlock.FontStyle == FontStyles.Italic; bool initialIsUnderline = textBlock.TextDecorations != null && textBlock.TextDecorations.Contains(TextDecorations.Underline[0]); - Type? editorWindowType = Type.GetType("CanvasPlugin.TextEditWindow"); if (editorWindowType == null) { @@ -324,7 +323,6 @@ private void ShowTextEditorModal(Border border) textBlock.FlowDirection = FlowDirection.LeftToRight; textBlock.TextWrapping = TextWrapping.Wrap; } - } } @@ -511,7 +509,6 @@ private ContextMenu CreateContextMenu(FrameworkElement element) deleteItem.Click += (s, e) => DeleteElement(element); contextMenu.Items.Add(deleteItem); - MenuItem bringForwardItem = new MenuItem { Header = "一つ手前へ移動", @@ -585,7 +582,6 @@ private void ChangeZOrder(UIElement? element, ZOrderChangeType changeType) int maxZ = children.OfType().Select(System.Windows.Controls.Panel.GetZIndex).DefaultIfEmpty(0).Max(); System.Windows.Controls.Panel.SetZIndex(element, maxZ + 1); - } else if (changeType == ZOrderChangeType.SendToBack) { @@ -594,7 +590,6 @@ private void ChangeZOrder(UIElement? element, ZOrderChangeType changeType) int minZ = children.OfType().Select(System.Windows.Controls.Panel.GetZIndex).DefaultIfEmpty(0).Min(); System.Windows.Controls.Panel.SetZIndex(element, minZ - 1); - } else { @@ -633,7 +628,6 @@ private void ChangeZOrder(UIElement? element, ZOrderChangeType changeType) } } - private void ContextMenu_BringToFront(object sender, RoutedEventArgs e) { MenuItem? item = sender as MenuItem; @@ -692,7 +686,6 @@ public void StickyNoteButton_Click(object sender, RoutedEventArgs e) VerticalAlignment = System.Windows.VerticalAlignment.Center, HorizontalAlignment = HorizontalAlignment.Stretch, - FontFamily = new System.Windows.Media.FontFamily("Segoe UI"), FontSize = 30, Foreground = Brushes.Black, @@ -1127,7 +1120,7 @@ public void MainCanvas_Drop(object sender, DragEventArgs e) }; Point dropPoint = e.GetPosition(MainCanvas); - AddElementToCanvas(newImage, dropPoint.X - newImage.Width / 2, dropPoint.Y - newImage.Height / 2); + AddElementToCanvas(newImage, dropPoint.X - (newImage.Width / 2), dropPoint.Y - (newImage.Height / 2)); SelectElement(newImage); } catch (Exception ex)