MCPcopy Create free account
hub / github.com/TranslucentTB/TranslucentTB / FillSpots

Method FillSpots

Xaml/Controls/UniformGrid.cpp:301–316  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

299 }
300
301 void UniformGrid::FillSpots(bool value, int row, int column, int width, int height)
302 {
303 RECT rect1 = { 0, 0, m_SpotsWidth, m_SpotsHeight }, rect2 = { column, row, column + width, row + height };
304
305 // Precompute bounds to skip branching in main loop
306 RECT bounds { };
307 IntersectRect(&bounds, &rect1, &rect2);
308
309 for (int i = bounds.top; i < bounds.bottom; i++)
310 {
311 for (int j = bounds.left; j < bounds.right; j++)
312 {
313 m_TakenSpots[(i * m_SpotsWidth) + j] = value;
314 }
315 }
316 }
317
318 std::experimental::generator<std::tuple<int, int>> UniformGrid::GetFreeSpots(int firstColumn, bool topDown)
319 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected