Crash when snapping verts to grid in vertex mode #1449
Comments
|
I will not be able to reproduce this. Can you please attach the brush to which you apply the snap operation? That way, all I have to do is select it and perform the snap. |
PritchardGSD
commented
Sep 28, 2016
|
crash.zip |
PritchardGSD
commented
Sep 28, 2016
|
One issue is that it's not 100% consistent, so sometimes it seems to snap correctly, and it always seems to snap correctly when loading the map from the report so getting the brushes right as they're about to crash seems to be a bit of guesswork. |
|
Yeah, I need a consistent and reliable reproduction, otherwise I'm just guessing. Maybe @ericwa has an idea? |
kduske
added bug Platform:All Priority:Medium
labels
Oct 2, 2016
kduske
added this to the
TrenchBroom 2.0.0
milestone
Oct 2, 2016
|
It looks like the crash is just happening when snapping in vertex mode, which I can reproduce.
|
|
Excellent, thank you @ericwa. I'll look into it. |
|
@ericwa unless you want to ;-) |
kduske
changed the title from
Crash when snapping verts to grid to Crash when snapping verts to grid in vertex mode
Oct 2, 2016
|
@kduske Looks like Maybe replace:
with:
|
|
No, I don't want to rely on dynamic_cast. Maybe it should actually be a VertexCommand subclass since it does actually change the vertices. No idea what I was thinking there, to be honest. |
|
Are you avoiding dynamic_cast altogether in TB? The |
|
Yes, I am. In fact, I'm trying to avoid downcasting altogether. In this instance it's dangerous, yes. But downcasts are very often a design smell, and dynamic casts (and instanceof etc. in Java) just hide the smell a little better so that it's harder to detect. |
kduske
added a commit
that referenced
this issue
Oct 3, 2016
|
|
kduske |
2380404
|
PritchardGSD commentedSep 28, 2016
lavabloom_quoth-crash-12.zip
lavabloom_quoth-crash-13.zip
Not much to say about this one. Zip file includes a screenshot of TB when I crashed, the vert with the error is pictured.
To reproduce:




Take this brush:
Cut it like this:
Extend it with shift-drag like this:
Vertex manipulate like this:
Then switch grid size to 1 and "Snap vertices to Grid"
On my system at least this produces a crash.