Skip to content

Commit

Permalink
#5746: Remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
codereader committed Sep 10, 2021
1 parent 2a7c274 commit c077ce2
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 53 deletions.
47 changes: 0 additions & 47 deletions radiant/textool/TexTool.cpp
Expand Up @@ -41,7 +41,6 @@ namespace
const char* const RKEY_SELECT_EPSILON = "user/ui/selectionEpsilon";

const float ZOOM_MODIFIER = 1.25f;
const float MOVE_FACTOR = 2.0f;

const float GRID_MAX = 1.0f;
const float GRID_DEFAULT = 0.0625f;
Expand All @@ -55,7 +54,6 @@ TexTool::TexTool() :
_selectionInfo(GlobalSelectionSystem().getSelectionInfo()),
_dragRectangle(false),
_manipulatorMode(false),
_viewOriginMove(false),
_grid(GRID_DEFAULT),
_gridActive(registry::getValue<bool>(RKEY_GRID_STATE)),
_updateNeeded(false)
Expand Down Expand Up @@ -542,11 +540,6 @@ void TexTool::endOperation(const std::string& commandName)

void TexTool::doMouseUp(const Vector2& coords, wxMouseEvent& event)
{
// End the origin move, if it was active before
if (event.RightUp() && !event.HasAnyModifiers()) {
_viewOriginMove = false;
}

// If we are in manipulation mode, end the move
if (event.LeftUp() && !event.HasAnyModifiers() && _manipulatorMode)
{
Expand Down Expand Up @@ -646,7 +639,6 @@ void TexTool::doMouseDown(const Vector2& coords, wxMouseEvent& event)
{
_manipulatorMode = false;
_dragRectangle = false;
_viewOriginMove = false;

if (event.LeftDown() && !event.HasAnyModifiers())
{
Expand Down Expand Up @@ -989,13 +981,6 @@ void TexTool::onMouseUp(wxMouseEvent& ev)
// Pass the call to the member method
doMouseUp(texCoords, ev);

#if 0
// Check for view origin movements
if (ev.RightDown() && !ev.HasAnyModifiers())
{
_viewOriginMove = false;
}
#endif
ev.Skip();
}

Expand All @@ -1010,14 +995,6 @@ void TexTool::onMouseDown(wxMouseEvent& ev)
// Pass the call to the member method
doMouseDown(texCoords, ev);

#if 0
// Check for view origin movements
if (ev.RightDown() && !ev.HasAnyModifiers())
{
_moveOriginRectangle.topLeft = Vector2(ev.GetX(), ev.GetY());
_viewOriginMove = true;
}
#endif
ev.Skip();
}

Expand All @@ -1031,30 +1008,6 @@ void TexTool::onMouseMotion(wxMouseEvent& ev)
// Pass the call to the member routine
doMouseMove(texCoords, ev);

#if 0
// Check for view origin movements
if (_viewOriginMove)
{
// Calculate the movement delta relative to the old window x,y coords
Vector2 delta = Vector2(ev.GetX(), ev.GetY()) - _moveOriginRectangle.topLeft;

AABB& texSpaceAABB = getVisibleTexSpace();

float speedFactor = _zoomFactor * MOVE_FACTOR;

float factorX = texSpaceAABB.extents[0] / _windowDims[0] * speedFactor;
float factorY = texSpaceAABB.extents[1] / _windowDims[1] * speedFactor;

texSpaceAABB.origin[0] -= delta[0] * factorX;
texSpaceAABB.origin[1] -= delta[1] * factorY;

// Store the new coordinates
_moveOriginRectangle.topLeft = Vector2(ev.GetX(), ev.GetY());

// Redraw to visualise the changes
draw();
}
#endif
ev.Skip();
}

Expand Down
6 changes: 0 additions & 6 deletions radiant/textool/TexTool.h
Expand Up @@ -75,18 +75,12 @@ class TexTool :
// The rectangle defining the manipulation's start and end point
textool::Rectangle _manipulateRectangle;

// The rectangle defining the moveOrigin operation's start and end point
textool::Rectangle _moveOriginRectangle;

// TRUE if we are in selection mode
bool _dragRectangle;

// TRUE if a manipulation is currently ongoing
bool _manipulatorMode;

// TRUE if the texspace center is being dragged around
bool _viewOriginMove;

// The current grid size
float _grid;

Expand Down

0 comments on commit c077ce2

Please sign in to comment.