Skip to content

Commit

Permalink
Merge pull request #1332 from VladiStep/glyphRectEditorFix
Browse files Browse the repository at this point in the history
A fix of a rare crash on "Wine".
  • Loading branch information
Grossley authored Apr 18, 2023
2 parents 7bbe91d + c3e9dc5 commit 17a6f2c
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand Down

0 comments on commit 17a6f2c

Please sign in to comment.