Skip to content

Commit

Permalink
#5773: After undo/redo the windings need to be updated otherwise the …
Browse files Browse the repository at this point in the history
…texture tool will render outdated coords
  • Loading branch information
codereader committed Oct 8, 2021
1 parent 241201d commit 36d5e16
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
14 changes: 14 additions & 0 deletions radiantcore/brush/BrushNode.cpp
Expand Up @@ -617,6 +617,20 @@ bool BrushNode::facesAreForcedVisible()
return isForcedVisible();
}

void BrushNode::onPostUndo()
{
// The windings are usually lazy-evaluated when some code
// is calling localAABB() during rendering.
// To avoid the texture tool from rendering old texture coords
// We evaluate the windings right after undo
m_brush.evaluateBRep();
}

void BrushNode::onPostRedo()
{
m_brush.evaluateBRep();
}

void BrushNode::_onTransformationChanged()
{
m_brush.transformChanged();
Expand Down
3 changes: 3 additions & 0 deletions radiantcore/brush/BrushNode.h
Expand Up @@ -169,6 +169,9 @@ class BrushNode :
// Should only be used by the internal Brush object
bool facesAreForcedVisible();

void onPostUndo() override;
void onPostRedo() override;

protected:
// Gets called by the Transformable implementation whenever
// scale, rotation or translation is changed.
Expand Down

0 comments on commit 36d5e16

Please sign in to comment.