translate as a text bucket property
When used, text is translated before being checked for collisions.
This commit is contained in:
@@ -108,11 +108,18 @@ BucketDescription StyleParser::parseBucket(JSVal value) {
|
||||
} else {
|
||||
throw Style::exception("alignment must be a string");
|
||||
}
|
||||
} else if (name == "translate") {
|
||||
if (value.IsArray()) {
|
||||
bucket.geometry.translate.x = value[(rapidjson::SizeType)0].GetDouble() * 24;
|
||||
bucket.geometry.translate.y = value[(rapidjson::SizeType)1].GetDouble() * -24;
|
||||
} else {
|
||||
throw Style::exception("translate must be a string");
|
||||
}
|
||||
} else if (name == "verticalAlignment") {
|
||||
if (value.IsString()) {
|
||||
bucket.geometry.vertical_alignment = verticalAlignmentType({ value.GetString(), value.GetStringLength() });
|
||||
} else {
|
||||
throw Style::exception("alignment must be a string");
|
||||
throw Style::exception("verticalAlignment must be a string");
|
||||
}
|
||||
} else if (name == "lineHeight") {
|
||||
if (value.IsNumber()) {
|
||||
|
||||
Reference in New Issue
Block a user