Skip to content

Commit

Permalink
#5649: Use the third component of the workzone origin to fill in the …
Browse files Browse the repository at this point in the history
…missing component when placing the camera using Ctrl-MMB
  • Loading branch information
codereader committed Jun 24, 2021
1 parent 899479b commit 9ad6d39
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions radiant/xyview/tools/CameraMoveTool.h
Expand Up @@ -4,6 +4,7 @@
#include "imousetool.h"
#include "iorthoview.h"
#include "icameraview.h"
#include "selectionlib.h"

namespace ui
{
Expand Down Expand Up @@ -87,16 +88,19 @@ class CameraMoveTool :

Vector3 origin = xyEvent.getWorldPos();

// Substitute the third component from the selection work zone
auto workzoneOrigin = GlobalSelectionSystem().getWorkZone().bounds.getOrigin();

switch (xyEvent.getViewType())
{
case XY:
origin[2] = camera.getCameraOrigin()[2];
origin[2] = workzoneOrigin[2];
break;
case YZ:
origin[0] = camera.getCameraOrigin()[0];
origin[0] = workzoneOrigin[0];
break;
case XZ:
origin[1] = camera.getCameraOrigin()[1];
origin[1] = workzoneOrigin[1];
break;
};

Expand Down

0 comments on commit 9ad6d39

Please sign in to comment.