diff --git a/UndertaleModTool/Editors/UndertaleFontEditor/EditGlyphRectangleWindow.xaml.cs b/UndertaleModTool/Editors/UndertaleFontEditor/EditGlyphRectangleWindow.xaml.cs index 4f0c8bef0..129434165 100644 --- a/UndertaleModTool/Editors/UndertaleFontEditor/EditGlyphRectangleWindow.xaml.cs +++ b/UndertaleModTool/Editors/UndertaleFontEditor/EditGlyphRectangleWindow.xaml.cs @@ -193,9 +193,7 @@ private void TextureViewbox_MouseLeftButtonDown(object sender, MouseButtonEventA } } - if (canvas is null) - return; - initPoint = e.GetPosition(canvas); + initPoint = e.GetPosition(TextureViewbox); if (isNewCharacter) { SelectedGlyph.SourceX = (ushort)Math.Round(initPoint.X); @@ -222,7 +220,7 @@ private void TextureViewbox_MouseLeftButtonUp(object sender, MouseButtonEventArg } private void TextureViewbox_MouseMove(object sender, MouseEventArgs e) { - var pos = e.GetPosition(canvas); + var pos = e.GetPosition(TextureViewbox); if (dragInProgress) { @@ -316,12 +314,12 @@ private void TextureViewbox_MouseMove(object sender, MouseEventArgs e) else { var hitType = GetHitType(selectedRect, pos); - canvas.Cursor = GetCursorForType(hitType); + TextureViewbox.Cursor = GetCursorForType(hitType); } } private void TextureViewbox_MouseMove_New(object sender, MouseEventArgs e) { - var pos = e.GetPosition(canvas); + var pos = e.GetPosition(TextureViewbox); if (dragInProgress) {