diff --git a/src/Classic/AbsBeamline/Bend2D.cpp b/src/Classic/AbsBeamline/Bend2D.cpp index 5a17537a6c751c2ca025c0f911e89e5d7553c03a..3ec257dfe91b8e07025dac5c50ce1b5d9cfd89d4 100644 --- a/src/Classic/AbsBeamline/Bend2D.cpp +++ b/src/Classic/AbsBeamline/Bend2D.cpp @@ -1702,7 +1702,7 @@ ElementBase::BoundingBox Bend2D::getBoundingBoxInLabCoords() const { bb.upperRightCorner = std::numeric_limits<double>::lowest(); Vector_t dY(0, 0.5 * getFullGap(), 0); - for (int i = -1; i < 2; i += 2) { + for (int i : {-1, 1}) { for (const Vector_t & vec: outline) { Vector_t vecInLabCoords = csTrafoGlobal2Local_m.transformFrom(vec + i * dY); for (unsigned int d = 0; d < 3; ++ d) { diff --git a/src/Classic/AbsBeamline/ElementBase.cpp b/src/Classic/AbsBeamline/ElementBase.cpp index 2582d9b2b96fa0f972910adb41bcbbc25fa173ff..8116211ae81f01819991422d63b875b7d91a6206 100644 --- a/src/Classic/AbsBeamline/ElementBase.cpp +++ b/src/Classic/AbsBeamline/ElementBase.cpp @@ -375,7 +375,7 @@ ElementBase::BoundingBox::getPointOfIntersection(const Vector_t & position, continue; } - return position + tau * normalizedDirection; + return position + delta; } relativePosition = upperRightCorner - position; }