Skip to content

Commit

Permalink
#5356: Leave the third coordinate of a clipper point untouched when m…
Browse files Browse the repository at this point in the history
…oving it in orthographic views
  • Loading branch information
codereader committed Oct 13, 2020
1 parent 81f3030 commit 0934ed2
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions radiant/xyview/tools/ClipperTool.cpp
Expand Up @@ -76,10 +76,19 @@ MouseTool::Result ClipperTool::onMouseMove(Event& ev)
}

// Check, if we have a clip point operation running
if (GlobalClipper().getMovingClip() != NULL)
if (GlobalClipper().getMovingClip() != nullptr)
{
GlobalClipper().getMovingClipCoords() = xyEvent.getWorldPos();
xyEvent.getView().snapToGrid(GlobalClipper().getMovingClipCoords());
// Leave the third coordinate of the clip point untouched (#5356)
auto viewType = xyEvent.getViewType();
int missingDim = viewType == XY ? 2 : viewType == YZ ? 0 : 1;
auto& clipCoords = GlobalClipper().getMovingClipCoords();

Vector3 newWorldPos = xyEvent.getWorldPos();
newWorldPos[missingDim] = clipCoords[missingDim];

xyEvent.getView().snapToGrid(newWorldPos);

GlobalClipper().getMovingClipCoords() = newWorldPos;
GlobalClipper().update();

GlobalMainFrame().updateAllWindows();
Expand Down

0 comments on commit 0934ed2

Please sign in to comment.