mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-29 16:25:42 +00:00
Merge pull request #463 from Azaezel/fix/terrainpainting
terrain brush dragging cleanups
This commit is contained in:
commit
dcf176f043
1 changed files with 13 additions and 16 deletions
|
|
@ -1841,6 +1841,7 @@ void TerrainEditor::on3DMouseMove(const Gui3DMouseEvent & event)
|
||||||
if(!hitTerrain)
|
if(!hitTerrain)
|
||||||
{
|
{
|
||||||
mMouseBrush->reset();
|
mMouseBrush->reset();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -1875,17 +1876,19 @@ void TerrainEditor::on3DMouseDragged(const Gui3DMouseEvent & event)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Point3F pos;
|
Point3F pos;
|
||||||
|
|
||||||
if ( !mSelectionLocked )
|
|
||||||
{
|
|
||||||
if ( !collide( event, pos) )
|
|
||||||
mMouseBrush->reset();
|
|
||||||
}
|
|
||||||
|
|
||||||
// check if the mouse has actually moved in grid space
|
|
||||||
bool selChanged = false;
|
bool selChanged = false;
|
||||||
|
|
||||||
if ( !mSelectionLocked )
|
if ( !mSelectionLocked )
|
||||||
{
|
{
|
||||||
|
TerrainBlock* hitTerrain = collide(event, pos);
|
||||||
|
|
||||||
|
if (!hitTerrain)
|
||||||
|
{
|
||||||
|
mMouseBrush->reset();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// check if the mouse has actually moved in grid space
|
||||||
Point2I gMouse;
|
Point2I gMouse;
|
||||||
Point2I gLastMouse;
|
Point2I gLastMouse;
|
||||||
worldToGrid( pos, gMouse );
|
worldToGrid( pos, gMouse );
|
||||||
|
|
@ -1896,14 +1899,8 @@ void TerrainEditor::on3DMouseDragged(const Gui3DMouseEvent & event)
|
||||||
|
|
||||||
selChanged = gMouse != gLastMouse;
|
selChanged = gMouse != gLastMouse;
|
||||||
}
|
}
|
||||||
|
if (selChanged)
|
||||||
if (String::compare(getCurrentAction(), "paintMaterial") != 0)
|
mCurrentAction->process( mMouseBrush, event, true, TerrainAction::Update );
|
||||||
{
|
|
||||||
if (mMouseDown)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
mCurrentAction->process( mMouseBrush, event, true, TerrainAction::Update );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TerrainEditor::on3DMouseUp(const Gui3DMouseEvent & event)
|
void TerrainEditor::on3DMouseUp(const Gui3DMouseEvent & event)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue