Skip to content

Commit 82dfcd2

Browse files
committed
Fix edge scroll bug when dynamic height is disabled
1 parent 6571d76 commit 82dfcd2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Source/OpenRTSCamera/Private/RTSCamera.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ void URTSCamera::EdgeScrollLeft() const
334334
const auto Movement = UKismetMathLibrary::FClamp(NormalizedMousePosition, 0.0, 1.0);
335335

336336
this->Root->AddRelativeLocation(
337-
-1 * this->SpringArm->GetRightVector() * Movement * this->EdgeScrollSpeed
337+
-1 * this->Root->GetRightVector() * Movement * this->EdgeScrollSpeed
338338
);
339339
}
340340

@@ -350,7 +350,7 @@ void URTSCamera::EdgeScrollRight() const
350350

351351
const auto Movement = UKismetMathLibrary::FClamp(NormalizedMousePosition, 0.0, 1.0);
352352
this->Root->AddRelativeLocation(
353-
this->SpringArm->GetRightVector() * Movement * this->EdgeScrollSpeed
353+
this->Root->GetRightVector() * Movement * this->EdgeScrollSpeed
354354
);
355355
}
356356

@@ -366,7 +366,7 @@ void URTSCamera::EdgeScrollUp() const
366366

367367
const auto Movement = 1 - UKismetMathLibrary::FClamp(NormalizedMousePosition, 0.0, 1.0);
368368
this->Root->AddRelativeLocation(
369-
this->SpringArm->GetForwardVector() * Movement * this->EdgeScrollSpeed
369+
this->Root->GetForwardVector() * Movement * this->EdgeScrollSpeed
370370
);
371371
}
372372

@@ -382,7 +382,7 @@ void URTSCamera::EdgeScrollDown() const
382382

383383
const auto Movement = UKismetMathLibrary::FClamp(NormalizedMousePosition, 0.0, 1.0);
384384
this->Root->AddRelativeLocation(
385-
-1 * this->SpringArm->GetForwardVector() * Movement * this->EdgeScrollSpeed
385+
-1 * this->Root->GetForwardVector() * Movement * this->EdgeScrollSpeed
386386
);
387387
}
388388

0 commit comments

Comments
 (0)