[core] consolidate Axonometric rendering API

Instead of having individual APIs for setting axonometric
and skew options, create ProjectionMode struct that holds
all the relevant options for Axonometric rendering and
introduce setter/getter on the Map for those options.
This commit is contained in:
Sudarsana Babu Nagineni
2019-03-06 14:30:23 +02:00
parent c6598fc5da
commit 744d92e763
9 changed files with 89 additions and 68 deletions

View File

@@ -268,6 +268,17 @@ TEST(Map, SetStyleDefaultCamera) {
EXPECT_DOUBLE_EQ(*camera.zoom, 0.5);
}
TEST(Map, ProjectionMode) {
MapTest<> test;
test.map.setProjectionMode(ProjectionMode().withAxonometric(true).withXSkew(1.0).withYSkew(0.0));
auto options = test.map.getProjectionMode();
EXPECT_TRUE(*options.axonometric);
EXPECT_EQ(*options.xSkew, 1.0);
EXPECT_EQ(*options.ySkew, 0.0);
}
TEST(Map, SetStyleInvalidJSON) {
Log::setObserver(std::make_unique<FixtureLogObserver>());