Add support for text-variable-anchor-offset property (#2921)

Co-authored-by: Yingfang Wang <junew@microsoft.com>
Co-authored-by: Alexey Kon <48697757+random3940@users.noreply.github.com>
This commit is contained in:
wangyingfang
2024-10-28 19:15:54 +08:00
committed by GitHub
parent 90a798bfee
commit 1a63194078
192 changed files with 5931 additions and 107 deletions

View File

@@ -58,6 +58,12 @@ TEST(Stringify, Color) {
ASSERT_EQ(stringify(Color::blue()), "\"rgba(0,0,255,1)\"");
}
TEST(Stringify, VariableAnchorOffsetCollection) {
std::array<float, 2> offset = {1, 1};
std::vector<AnchorOffsetPair> test{{AnchorOffsetPair{SymbolAnchorType::Left, offset}}};
ASSERT_EQ(stringify(VariableAnchorOffsetCollection(std::move(test))), "[\"left\",[1.0,1.0]]");
}
TEST(Stringify, Array) {
ASSERT_EQ(stringify(std::array<float, 2>{{1, 2}}), "[1.0,2.0]");
}