mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-12-11 22:44:19 +00:00
General: Make use of ranged for where applicable
This commit is contained in:
@@ -13,7 +13,7 @@ CScaleNodeCommand::CScaleNodeCommand(INodeEditor *pEditor, const QList<CSceneNod
|
||||
{
|
||||
mNodeList.reserve(rkNodes.size());
|
||||
|
||||
foreach (CSceneNode *pNode, rkNodes)
|
||||
for (CSceneNode *pNode : rkNodes)
|
||||
{
|
||||
SNodeScale Scale;
|
||||
Scale.pNode = pNode;
|
||||
@@ -74,9 +74,10 @@ bool CScaleNodeCommand::mergeWith(const QUndoCommand *pkOther)
|
||||
|
||||
void CScaleNodeCommand::undo()
|
||||
{
|
||||
if (!mpEditor) return;
|
||||
if (!mpEditor)
|
||||
return;
|
||||
|
||||
foreach (SNodeScale Scale, mNodeList)
|
||||
for (SNodeScale& Scale : mNodeList)
|
||||
{
|
||||
Scale.pNode->SetPosition(Scale.InitialPos);
|
||||
Scale.pNode->SetScale(Scale.InitialScale);
|
||||
@@ -88,9 +89,10 @@ void CScaleNodeCommand::undo()
|
||||
|
||||
void CScaleNodeCommand::redo()
|
||||
{
|
||||
if (!mpEditor) return;
|
||||
if (!mpEditor)
|
||||
return;
|
||||
|
||||
foreach (SNodeScale Scale, mNodeList)
|
||||
for (SNodeScale& Scale : mNodeList)
|
||||
{
|
||||
Scale.pNode->SetPosition(Scale.NewPos);
|
||||
Scale.pNode->SetScale(Scale.NewScale);
|
||||
|
||||
Reference in New Issue
Block a user