Skip to content
Snippets Groups Projects
Unverified Commit 43256fdb authored by Pospelov, Gennady's avatar Pospelov, Gennady Committed by GitHub
Browse files

Merge pull request #652 from waltervh/release-1.13.0

Fix bug #2188: Real space widget silently crashes with 1d interference function with xi=90 degrees
parents 013c7040 85a32810
No related branches found
No related tags found
No related merge requests found
......@@ -40,6 +40,7 @@ BornAgain-1.13.0, released 2018.10.05
* Bug #2176: No plot updates during fitting anymore
* Bug #2187: Wrong parameter values displayed in real time widget
* Bug #2123: GUI: switching to another fit parameter causes plot reset to the initial value of previous fit parameter
* Bug #2188: Real space widget silently crashes with 1d interference function with xi=90 degrees
* Feature #2039: Switch all Python fitting examples from FitSuite to the new Minimizer
* Feature #2051: Provide loading and using from GUI 1D real data
* Feature #2070: 3D view: modify default particle density of GUI examples to look reasonable in 3D view
......
......@@ -181,11 +181,11 @@ std::vector<std::vector<double>> RealSpaceBuilderUtils::computeInterference2DLat
// Estimate the limit n1 and n2 of the integer multiple i and j of the lattice vectors required
// for populating particles correctly within the 3D model's boundaries
int n1 = 0, n2 = 0;
n1 = static_cast<int>(layer_size * 2) / static_cast<int>(l1 * std::cos(l_xi));
n1 = l1 == 0.0 ? 2 : static_cast<int>(layer_size * 2 / l1);
// This condition is required when this function is used to compute 1D Lattice positions
if (l2 != 0) {
n2 = static_cast<int>(layer_size * 2) / static_cast<int>(l2 * std::sin(l_alpha + l_xi));
n2 = l2 == 0.0 ? 2 : static_cast<int>(layer_size * 2 / l2);
n1 = std::max(n1, n2);
n2 = std::max(n1, n2);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment