Skip to content

Commit

Permalink
Correct issue with buffer size on horizontal line group #4543
Browse files Browse the repository at this point in the history
  • Loading branch information
derwin12 authored and dkulp committed May 6, 2024
1 parent 07856ac commit 32a9e28
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions xLights/models/ModelGroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -731,8 +731,16 @@ bool ModelGroup::Reset(bool zeroBased) {
if( GetCentreDefined()) {
float cx = GetCentreX();
float cy = GetCentreY();
offsetX = ((cx - ((xminx + xmaxx) / 2.0)) * 2000.0) / (xmaxx - xminx);
offsetY = ((cy - ((xminy + xmaxy) / 2.0)) * 2000.0) / (xmaxy - xminy);
if (xmaxx == xminx) {
offsetX = 0;
} else {
offsetX = ((cx - ((xminx + xmaxx) / 2.0)) * 2000.0) / (xmaxx - xminx);
}
if (xmaxy == xminy) {
offsetY = 0;
} else {
offsetY = ((cy - ((xminy + xmaxy) / 2.0)) * 2000.0) / (xmaxy - xminy);
}
} else {
offsetX = GetXCentreOffset();
offsetY = GetYCentreOffset();
Expand Down

0 comments on commit 32a9e28

Please sign in to comment.