[core] auto value for 'text-justify' field

This commit is contained in:
Mikhail Pozdnyakov
2019-03-07 19:09:28 +02:00
parent 2b9a52f5e4
commit 9fc42b9c3c
5 changed files with 9 additions and 4 deletions

View File

@@ -81,6 +81,7 @@ enum class AlignmentType : uint8_t {
};
enum class TextJustifyType : uint8_t {
Auto,
Center,
Left,
Right

View File

@@ -322,6 +322,10 @@ public final class Property {
// TEXT_JUSTIFY: Text justification options.
/**
* The text is aligned towards the anchor position.
*/
public static final String TEXT_JUSTIFY_AUTO = "auto";
/**
* The text is aligned to the left.
*/
@@ -339,6 +343,7 @@ public final class Property {
* Text justification options.
*/
@StringDef({
TEXT_JUSTIFY_AUTO,
TEXT_JUSTIFY_LEFT,
TEXT_JUSTIFY_CENTER,
TEXT_JUSTIFY_RIGHT,

View File

@@ -559,7 +559,7 @@ public class SymbolLayerTest extends BaseLayerTest {
assertNull(layer.getTextJustify().getValue());
// Set and Get
String propertyValue = TEXT_JUSTIFY_LEFT;
String propertyValue = TEXT_JUSTIFY_AUTO;
layer.setProperties(textJustify(propertyValue));
assertEquals(layer.getTextJustify().getValue(), propertyValue);
}

View File

@@ -3,6 +3,4 @@ var spec = module.exports = require('../mapbox-gl-js/src/style-spec/reference/v8
// Make temporary modifications here when Native doesn't have all features that JS has.
delete spec.layout_symbol['symbol-sort-key'];
delete spec.layout_symbol['symbol-z-order'].values['auto'];
spec.layout_symbol['symbol-z-order'].default = 'viewport-y';
delete spec.layout_symbol['text-justify'].values['auto'];
spec.layout_symbol['symbol-z-order'].default = 'viewport-y';

View File

@@ -83,6 +83,7 @@ MBGL_DEFINE_ENUM(SymbolZOrderType, {
});
MBGL_DEFINE_ENUM(TextJustifyType, {
{ TextJustifyType::Auto, "auto" },
{ TextJustifyType::Center, "center" },
{ TextJustifyType::Left, "left" },
{ TextJustifyType::Right, "right" },