Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
#5746: Fix TexTool::forceRedraw() not immediately repainting.
  • Loading branch information
codereader committed Sep 26, 2021
1 parent e8a5dae commit 09a52d1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
16 changes: 2 additions & 14 deletions radiant/textool/TexTool.cpp
Expand Up @@ -52,7 +52,6 @@ TexTool::TexTool() :
_glWidget(new wxutil::GLWidget(this, std::bind(&TexTool::onGLDraw, this), "TexTool")),
_grid(GRID_DEFAULT),
_gridActive(registry::getValue<bool>(RKEY_GRID_STATE)),
_updateNeeded(false),
_selectionRescanNeeded(false),
_manipulatorModeToggleRequestHandler(std::numeric_limits<std::size_t>::max()),
_componentSelectionModeToggleRequestHandler(std::numeric_limits<std::size_t>::max()),
Expand Down Expand Up @@ -368,19 +367,13 @@ void TexTool::onIdle(wxIdleEvent& ev)
{
_selectionRescanNeeded = false;
update();
_updateNeeded = true;
queueDraw();
}

if (_updateNeeded)
{
_updateNeeded = false;
draw();
}
}

void TexTool::queueDraw()
{
_updateNeeded = true;
_glWidget->Refresh();
}

void TexTool::scrollByPixels(int x, int y)
Expand Down Expand Up @@ -702,11 +695,6 @@ void TexTool::updateProjection()

bool TexTool::onGLDraw()
{
if (_updateNeeded)
{
return false; // stop here, wait for the next idle event to refresh
}

// Initialise the viewport
glViewport(0, 0, _windowDims[0], _windowDims[1]);
glMatrixMode(GL_PROJECTION);
Expand Down
1 change: 0 additions & 1 deletion radiant/textool/TexTool.h
Expand Up @@ -70,7 +70,6 @@ class TexTool :
bool _gridActive;

// For idle callbacks
bool _updateNeeded;
bool _selectionRescanNeeded;

sigc::connection _sceneSelectionChanged;
Expand Down

0 comments on commit 09a52d1

Please sign in to comment.