Skip to content

Commit e933583

Browse files
committed
fix compile error
1 parent f0058b7 commit e933583

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lgfx/v1/LGFXBase.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,7 +1090,7 @@ namespace lgfx
10901090
float fmidy = midy*hratio;
10911091
float hyp0 = pixelDistance( midx, midy, 0, 0 );
10921092

1093-
rgb888_t scanline[w];
1093+
auto scanline = (rgb888_t*)alloca(w * sizeof(rgb888_t));
10941094

10951095
startWrite();
10961096
for( int _y=0;_y<h;_y++ ) {
@@ -1117,7 +1117,7 @@ namespace lgfx
11171117
if( !gradient.colors || gradient.count==0 ) return;
11181118
bool is_vertical = style==VLINEAR;
11191119
const uint32_t gradient_len = is_vertical ? h : w;
1120-
rgb888_t scanline[gradient_len];
1120+
auto scanline = (rgb888_t*)alloca(gradient_len * sizeof(rgb888_t));
11211121
for(int i=0;i<gradient_len;i++) { // memoize one gradient scanline
11221122
scanline[i] = map_gradient( i, 0, gradient_len, gradient );
11231123
}

0 commit comments

Comments
 (0)