Skip to content

Commit

Permalink
Merge pull request #171 from Brandon502/mdev
Browse files Browse the repository at this point in the history
Expand1D Arc - No holes, and filling the complete panel
  • Loading branch information
softhack007 authored Oct 17, 2024
2 parents 6fc207b + e37afd0 commit 2ac354a
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions wled00/FX_fcn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -869,9 +869,12 @@ uint16_t Segment::virtualLength() const {
vLen = vH;
break;
case M12_pCorner:
case M12_pArc:
vLen = max(vW,vH); // get the longest dimension
break;
case M12_pArc:
vLen = sqrt16(vW * vW + vH * vH);
if (vW != vH) vLen++; // round up
break;
case M12_jMap: //WLEDMM jMap
if (jMap)
vLen = ((JMapC *)jMap)->length();
Expand Down Expand Up @@ -1218,11 +1221,18 @@ uint32_t __attribute__((hot)) Segment::getPixelColor(int i) const
if (vStrip>0) return getPixelColorXY(vStrip - 1, vH - i -1);
else return getPixelColorXY(0, vH - i -1);
break;
case M12_pArc:
case M12_pCorner:
// use longest dimension
return vW>vH ? getPixelColorXY(i, 0) : getPixelColorXY(0, i);
case M12_pArc: {
if (i < max(vW, vH)) {
return vW>vH ? getPixelColorXY(i, 0) : getPixelColorXY(0, i); // Corner and Arc
break;
}
int length = virtualLength();
int x = i * vW / length;
int y = i * vH / length;
return getPixelColorXY(x, y); // Not 100% accurate
break;
}
case M12_jMap: //WLEDMM jMap
if (jMap)
return ((JMapC *)jMap)->getPixelColor(i);
Expand Down

0 comments on commit 2ac354a

Please sign in to comment.