Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] add protect #75: Fixing a crash in GUI related to 0-width frames #81

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion gui/DirectX/DynamicMesh.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ int[] GetTriIndicesList()

public virtual void AddRect(Rect rect, System.Windows.Media.Color color)
{
rect = new Rect(InverseLocalTransform.Transform(rect.Location), new Size(InverseLocalTransform.M11 * rect.Size.Width, InverseLocalTransform.M22 * rect.Size.Height));
double width = (rect.Size.Width < 0) ? 0 : rect.Size.Width;
double height = (rect.Size.Height < 0) ? 0 : rect.Size.Height;
rect = new Rect(InverseLocalTransform.Transform(rect.Location), new Size(InverseLocalTransform.M11 * width, InverseLocalTransform.M22 * height));

int index = Vertices.Count;
SharpDX.Color c = Utils.Convert(color);
Expand Down
6 changes: 5 additions & 1 deletion gui/ThreadView/ThreadView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,11 @@ void DrawSelection(DirectX.DirectXCanvas canvas)

for (int i = 0; i < SelectionBorderCount; ++i)
{
rect.Inflate(SelectionBorderStep, SelectionBorderStep);
if (rect.IsEmpty)
{
break;
}
rect.Inflate(SelectionBorderStep, SelectionBorderStep);
SelectionMesh.AddRect(rect, FrameSelection.Color);
}
}
Expand Down