Skip to content
This repository was archived by the owner on May 6, 2021. It is now read-only.

Commit b365c4c

Browse files
committed
Fix integration area = 0 for a led
1 parent afc8e8e commit b365c4c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

libsrc/hyperion/ImageToLedsMap.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,16 @@ ImageToLedsMap::ImageToLedsMap(
3535
// skip leds without area
3636
if ((led.maxX_frac-led.minX_frac) < 1e-6 || (led.maxY_frac-led.minY_frac) < 1e-6)
3737
{
38+
mColorsMap.emplace_back();
3839
continue;
3940
}
40-
41+
4142
// Compute the index boundaries for this led
4243
unsigned minX_idx = xOffset + unsigned(std::round(actualWidth * led.minX_frac));
4344
unsigned maxX_idx = xOffset + unsigned(std::round(actualWidth * led.maxX_frac));
4445
unsigned minY_idx = yOffset + unsigned(std::round(actualHeight * led.minY_frac));
4546
unsigned maxY_idx = yOffset + unsigned(std::round(actualHeight * led.maxY_frac));
46-
47+
4748
// make sure that the area is at least a single led large
4849
minX_idx = std::min(minX_idx, xOffset + actualWidth - 1);
4950
if (minX_idx == maxX_idx)

0 commit comments

Comments
 (0)