@@ -754,7 +754,7 @@ uint16_t IRAM_ATTR Segment::virtualLength() const {
754754bool IRAM_ATTR Segment::isPixelClipped (int i) {
755755#ifndef WLED_DISABLE_MODE_BLEND
756756 if (_clipStart != _clipStop && blendingStyle > BLEND_STYLE_FADE) {
757- bool invert = _clipStart > _clipStop; // ineverted start & stop
757+ bool invert = _clipStart > _clipStop; // ineverted start & stop
758758 int start = invert ? _clipStop : _clipStart;
759759 int stop = invert ? _clipStart : _clipStop;
760760 if (blendingStyle == BLEND_STYLE_FAIRY_DUST) {
@@ -892,7 +892,8 @@ void IRAM_ATTR Segment::setPixelColor(int i, uint32_t col)
892892#endif
893893
894894#ifndef WLED_DISABLE_MODE_BLEND
895- if (!_modeBlend && (blendingStyle == BLEND_STYLE_PUSH_RIGHT || blendingStyle == BLEND_STYLE_PUSH_LEFT)) {
895+ // if we blend using "push" style we need to "shift" new mode to left or right
896+ if (isInTransition () && !_modeBlend && (blendingStyle == BLEND_STYLE_PUSH_RIGHT || blendingStyle == BLEND_STYLE_PUSH_LEFT)) {
896897 unsigned prog = 0xFFFF - progress ();
897898 unsigned dI = prog * vL / 0xFFFF ;
898899 if (blendingStyle == BLEND_STYLE_PUSH_RIGHT) i -= dI;
@@ -1043,7 +1044,7 @@ uint32_t IRAM_ATTR Segment::getPixelColor(int i)
10431044#endif
10441045
10451046#ifndef WLED_DISABLE_MODE_BLEND
1046- if (!_modeBlend && (blendingStyle == BLEND_STYLE_PUSH_RIGHT || blendingStyle == BLEND_STYLE_PUSH_LEFT)) {
1047+ if (isInTransition () && !_modeBlend && (blendingStyle == BLEND_STYLE_PUSH_RIGHT || blendingStyle == BLEND_STYLE_PUSH_LEFT)) {
10471048 unsigned prog = 0xFFFF - progress ();
10481049 unsigned dI = prog * vL / 0xFFFF ;
10491050 if (blendingStyle == BLEND_STYLE_PUSH_RIGHT) i -= dI;
@@ -1425,43 +1426,47 @@ void WS2812FX::service() {
14251426 unsigned dw = p * w / 0xFFFFU + 1 ;
14261427 unsigned dh = p * h / 0xFFFFU + 1 ;
14271428 switch (blendingStyle) {
1428- case BLEND_STYLE_FAIRY_DUST: // fairy dust (must set entire segment, see isPixelXYClipped())
1429+ case BLEND_STYLE_FAIRY_DUST: // fairy dust (must set entire segment, see isPixelXYClipped())
14291430 Segment::setClippingRect (0 , w, 0 , h);
14301431 break ;
14311432 case BLEND_STYLE_SWIPE_RIGHT: // left-to-right
1433+ case BLEND_STYLE_PUSH_RIGHT: // left-to-right
14321434 Segment::setClippingRect (0 , dw, 0 , h);
14331435 break ;
1434- case BLEND_STYLE_SWIPE_LEFT: // right-to-left
1436+ case BLEND_STYLE_SWIPE_LEFT: // right-to-left
1437+ case BLEND_STYLE_PUSH_LEFT: // right-to-left
14351438 Segment::setClippingRect (w - dw, w, 0 , h);
14361439 break ;
1437- case BLEND_STYLE_PINCH_OUT: // corners
1440+ case BLEND_STYLE_PINCH_OUT: // corners
14381441 Segment::setClippingRect ((w + dw)/2 , (w - dw)/2 , (h + dh)/2 , (h - dh)/2 ); // inverted!!
14391442 break ;
1440- case BLEND_STYLE_INSIDE_OUT: // outward
1443+ case BLEND_STYLE_INSIDE_OUT: // outward
14411444 Segment::setClippingRect ((w - dw)/2 , (w + dw)/2 , (h - dh)/2 , (h + dh)/2 );
14421445 break ;
1443- case BLEND_STYLE_SWIPE_DOWN: // top-to-bottom (2D)
1446+ case BLEND_STYLE_SWIPE_DOWN: // top-to-bottom (2D)
1447+ case BLEND_STYLE_PUSH_DOWN: // top-to-bottom (2D)
14441448 Segment::setClippingRect (0 , w, 0 , dh);
14451449 break ;
1446- case BLEND_STYLE_SWIPE_UP: // bottom-to-top (2D)
1450+ case BLEND_STYLE_SWIPE_UP: // bottom-to-top (2D)
1451+ case BLEND_STYLE_PUSH_UP: // bottom-to-top (2D)
14471452 Segment::setClippingRect (0 , w, h - dh, h);
14481453 break ;
1449- case BLEND_STYLE_OPEN_H: // horizontal-outward (2D) same look as INSIDE_OUT on 1D
1454+ case BLEND_STYLE_OPEN_H: // horizontal-outward (2D) same look as INSIDE_OUT on 1D
14501455 Segment::setClippingRect ((w - dw)/2 , (w + dw)/2 , 0 , h);
14511456 break ;
1452- case BLEND_STYLE_OPEN_V: // vertical-outward (2D)
1457+ case BLEND_STYLE_OPEN_V: // vertical-outward (2D)
14531458 Segment::setClippingRect (0 , w, (h - dh)/2 , (h + dh)/2 );
14541459 break ;
1455- case BLEND_STYLE_PUSH_TL: // TL-to-BR (2D)
1460+ case BLEND_STYLE_PUSH_TL: // TL-to-BR (2D)
14561461 Segment::setClippingRect (0 , dw, 0 , dh);
14571462 break ;
1458- case BLEND_STYLE_PUSH_TR: // TR-to-BL (2D)
1463+ case BLEND_STYLE_PUSH_TR: // TR-to-BL (2D)
14591464 Segment::setClippingRect (w - dw, w, 0 , dh);
14601465 break ;
1461- case BLEND_STYLE_PUSH_BR: // BR-to-TL (2D)
1466+ case BLEND_STYLE_PUSH_BR: // BR-to-TL (2D)
14621467 Segment::setClippingRect (w - dw, w, h - dh, h);
14631468 break ;
1464- case BLEND_STYLE_PUSH_BL: // BL-to-TR (2D)
1469+ case BLEND_STYLE_PUSH_BL: // BL-to-TR (2D)
14651470 Segment::setClippingRect (0 , dw, h - dh, h);
14661471 break ;
14671472 }
0 commit comments