Skip to content

Commit b66615c

Browse files
committed
fix: update test to reference RGBA texture
1 parent 8e4cc05 commit b66615c

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

tests/cases/quadFeature.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ describe('geo.quadFeature', function () {
589589
restoreWebglRenderer();
590590
});
591591

592-
it('texture data - RGB format', function () {
592+
it('texture data - RGBA format', function () {
593593
mockWebglRenderer();
594594
var map, layer, quad;
595595
map = createMap();
@@ -598,24 +598,24 @@ describe('geo.quadFeature', function () {
598598

599599
// Create RGB texture data (4 bytes per pixel)
600600
var width = 64, height = 64;
601-
var rgbData = new Uint8Array(width * height * 4);
601+
var rgbaData = new Uint8Array(width * height * 4);
602602

603603
// Fill with a gradient pattern
604-
for (var i = 0; i < rgbData.length; i += 4) {
605-
var pixelIndex = i / 3;
604+
for (var i = 0; i < rgbaData.length; i += 4) {
605+
var pixelIndex = i / 4;
606606
var x = pixelIndex % width;
607607
var y = Math.floor(pixelIndex / width);
608-
rgbData[i] = Math.floor((x / width) * 255); // R
609-
rgbData[i + 1] = Math.floor((y / height) * 255); // G
610-
rgbData[i + 2] = 128; // B
611-
rgbData[i + 3] = 255; // A
608+
rgbaData[i] = Math.floor((x / width) * 255); // R
609+
rgbaData[i + 1] = Math.floor((y / height) * 255); // G
610+
rgbaData[i + 2] = 128; // B
611+
rgbaData[i + 3] = 255; // A
612612
}
613613

614614
var textureData = [{
615615
ll: [-1, -1],
616616
ur: [1, 1],
617617
texture: {
618-
data: rgbData,
618+
data: rgbaData,
619619
width: width,
620620
height: height
621621
}
@@ -629,7 +629,7 @@ describe('geo.quadFeature', function () {
629629
expect(quads.imgQuads[0].imageTexture).toBeDefined();
630630
expect(quads.imgQuads[0].imageTexture.width).toBe(width);
631631
expect(quads.imgQuads[0].imageTexture.height).toBe(height);
632-
expect(quads.imgQuads[0].imageTexture.data).toBe(rgbData);
632+
expect(quads.imgQuads[0].imageTexture.data).toBe(rgbaData);
633633

634634
destroyMap();
635635
restoreWebglRenderer();

0 commit comments

Comments
 (0)