Skip to content

Commit 564dbb8

Browse files
author
hpinkos
committed
rectangle zero rotation
1 parent 8df4017 commit 564dbb8

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

Source/Core/RectangleGeometryLibrary.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ define([
112112
var granYSin = 0.0;
113113
var granXSin = 0.0;
114114

115-
if (defined(rotation)) { // rotation doesn't work when center is on/near IDL
115+
if (defined(rotation) && rotation !== 0) { // rotation doesn't work when center is on/near IDL
116116
var cosRotation = Math.cos(rotation);
117117
granYCos *= cosRotation;
118118
granXCos *= cosRotation;

Specs/Core/RectangleGeometrySpec.js

+13
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,19 @@ defineSuite([
292292
expect(CesiumMath.toDegrees(r.west)).toEqual(-1.4094456877799821);
293293
});
294294

295+
it('computing rectangle property with zero rotation', function() {
296+
var rectangle = Rectangle.MAX_VALUE;
297+
var geometry = new RectangleGeometry({
298+
vertexFormat : VertexFormat.POSITION_ONLY,
299+
rectangle : rectangle,
300+
granularity : 1.0,
301+
rotation : 0
302+
});
303+
304+
var r = geometry.rectangle;
305+
expect(r).toEqual(rectangle);
306+
});
307+
295308
var rectangle = new RectangleGeometry({
296309
vertexFormat : VertexFormat.POSITION_ONLY,
297310
rectangle : new Rectangle(-2.0, -1.0, 0.0, 1.0),

0 commit comments

Comments
 (0)