Skip to content

Commit

Permalink
Expand1D Corner Fix, Arc gPC fix.
Browse files Browse the repository at this point in the history
Only matripix is not working correctly on arc. Effect starts at the end of the strip and use gPC to fill to beginning.
  • Loading branch information
Brandon502 committed Oct 16, 2024
1 parent c1e75ac commit e37afd0
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions wled00/FX_fcn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -869,6 +869,8 @@ uint16_t Segment::virtualLength() const {
vLen = vH;
break;
case M12_pCorner:
vLen = max(vW,vH); // get the longest dimension
break;
case M12_pArc:
vLen = sqrt16(vW * vW + vH * vH);
if (vW != vH) vLen++; // round up
Expand Down Expand Up @@ -1219,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 e37afd0

Please sign in to comment.