Fix camera zone lock bounds

This commit is contained in:
2026-06-09 14:35:06 +08:00
parent 3a56db3dc7
commit 493b2bd3b8
5 changed files with 15 additions and 6 deletions
+4 -1
View File
@@ -28,7 +28,10 @@ void CameraController::Configure(const CameraControllerConfig& config) {
}
void CameraController::SetWorldBounds(const frostbite2D::Rect& worldBounds) {
config_.worldBounds = worldBounds;
const float width = std::max(worldBounds.width(), config_.viewportWidth);
const float height = std::max(worldBounds.height(), config_.viewportHeight);
config_.worldBounds =
frostbite2D::Rect(worldBounds.left(), worldBounds.top(), width, height);
}
void CameraController::SnapToTarget(frostbite2D::Camera& camera,