@@ -148,38 +148,37 @@ void mode_copy_segment(void) {
148148 Segment& sourcesegment = strip.getSegment (sourceid);
149149
150150 if (sourcesegment.isActive ()) {
151- uint32_t sourcecolor;
152- uint32_t destcolor;
151+ CRGBW color;
153152 if (sourcesegment.is2D ()) { // 2D source, note: 2D to 1D just copies the first row (or first column if 'Switch axis' is checked in FX)
154153 for (unsigned y = 0 ; y < SEGMENT.vHeight (); y++) {
155154 for (unsigned x = 0 ; x < SEGMENT.vWidth (); x++) {
156155 unsigned sx = x; // source coordinates
157156 unsigned sy = y;
158157 if (SEGMENT.check1 ) std::swap (sx, sy); // flip axis
159158 if (SEGMENT.check2 ) {
160- sourcecolor = strip.getPixelColorXY (sx + sourcesegment.start , sy + sourcesegment.startY ); // read from global buffer (reads the last rendered frame)
159+ color = strip.getPixelColorXY (sx + sourcesegment.start , sy + sourcesegment.startY ); // read from global buffer (reads the last rendered frame)
161160 }
162161 else {
163162 sourcesegment.setDrawDimensions (); // set to source segment dimensions
164- sourcecolor = sourcesegment.getPixelColorXY (sx, sy); // read from segment buffer
163+ color = sourcesegment.getPixelColorXY (sx, sy); // read from segment buffer
165164 }
166- destcolor = adjust_color (sourcecolor , SEGMENT.intensity , SEGMENT.custom1 , SEGMENT.custom2 );
165+ adjust_color (color , SEGMENT.intensity , SEGMENT.custom1 , SEGMENT.custom2 );
167166 SEGMENT.setDrawDimensions (); // reset to current segment dimensions
168- SEGMENT.setPixelColorXY (x, y, destcolor );
167+ SEGMENT.setPixelColorXY (x, y, color );
169168 }
170169 }
171170 } else { // 1D source, source can be expanded into 2D
172171 for (unsigned i = 0 ; i < SEGMENT.vLength (); i++) {
173172 if (SEGMENT.check2 ) {
174- sourcecolor = strip.getPixelColorNoMap (i + sourcesegment.start ); // read from global buffer (reads the last rendered frame)
173+ color = strip.getPixelColorNoMap (i + sourcesegment.start ); // read from global buffer (reads the last rendered frame)
175174 }
176175 else {
177176 sourcesegment.setDrawDimensions (); // set to source segment dimensions
178- sourcecolor = sourcesegment.getPixelColor (i);
177+ color = sourcesegment.getPixelColor (i);
179178 }
180- destcolor = adjust_color (sourcecolor , SEGMENT.intensity , SEGMENT.custom1 , SEGMENT.custom2 );
179+ adjust_color (color , SEGMENT.intensity , SEGMENT.custom1 , SEGMENT.custom2 );
181180 SEGMENT.setDrawDimensions (); // reset to current segment dimensions
182- SEGMENT.setPixelColor (i, destcolor );
181+ SEGMENT.setPixelColor (i, color );
183182 }
184183 }
185184 }
0 commit comments