Skip to content

Commit

Permalink
Add polyline test for width of 0.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
bagnell committed Apr 30, 2013
1 parent 2e39b84 commit b0233d1
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions Specs/Scene/PolylineCollectionSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1503,6 +1503,35 @@ defineSuite([
expect(context.readPixels()).toNotEqual([0, 0, 0, 0]);
});

it('does not render with width 0.0', function() {
var positions = [
{
x : -1.0,
y : 1.0,
z : 0.0
},{
x : -1.0,
y : -1.0,
z : 0.0
}];
var line = polylines.add({
positions : positions
});

ClearCommand.ALL.execute(context);
expect(context.readPixels()).toEqual([0, 0, 0, 0]);

render(context, frameState, polylines);
expect(context.readPixels()).toNotEqual([0, 0, 0, 0]);

ClearCommand.ALL.execute(context);
expect(context.readPixels()).toEqual([0, 0, 0, 0]);

line.setWidth(0.0);
render(context, frameState, polylines);
expect(context.readPixels()).toEqual([0, 0, 0, 0]);
});

it('changes polyline position size recreates vertex arrays', function() {
var positions = [];
for(var i = 0; i < 20; ++i){
Expand Down

0 comments on commit b0233d1

Please sign in to comment.