diff options
Diffstat (limited to 'source/blender/freestyle/intern/view_map/AverageAreaGridDensityProvider.cpp')
-rw-r--r-- | source/blender/freestyle/intern/view_map/AverageAreaGridDensityProvider.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/freestyle/intern/view_map/AverageAreaGridDensityProvider.cpp b/source/blender/freestyle/intern/view_map/AverageAreaGridDensityProvider.cpp index 2d8d3b30f84..61ad78a8567 100644 --- a/source/blender/freestyle/intern/view_map/AverageAreaGridDensityProvider.cpp +++ b/source/blender/freestyle/intern/view_map/AverageAreaGridDensityProvider.cpp @@ -83,6 +83,13 @@ void AverageAreaGridDensityProvider::initialize(const real proscenium[4], real s } _cellSize = sqrt(cellArea); + unsigned maxCells = 931; // * 1.1 = 1024 + if (std::max(prosceniumWidth, prosceniumHeight) / _cellSize > maxCells) { + if (G.debug & G_DEBUG_FREESTYLE) { + cout << "Scene-dependent cell size (" << _cellSize << " square) is too small." << endl; + } + _cellSize = std::max(prosceniumWidth, prosceniumHeight) / maxCells; + } // Now we know how many cells make each side of our grid _cellsX = ceil(prosceniumWidth / _cellSize); _cellsY = ceil(prosceniumHeight / _cellSize); |