[core] auto value for 'text-justify' field
This commit is contained in:
@@ -81,6 +81,7 @@ enum class AlignmentType : uint8_t {
|
||||
};
|
||||
|
||||
enum class TextJustifyType : uint8_t {
|
||||
Auto,
|
||||
Center,
|
||||
Left,
|
||||
Right
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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';
|
||||
@@ -83,6 +83,7 @@ MBGL_DEFINE_ENUM(SymbolZOrderType, {
|
||||
});
|
||||
|
||||
MBGL_DEFINE_ENUM(TextJustifyType, {
|
||||
{ TextJustifyType::Auto, "auto" },
|
||||
{ TextJustifyType::Center, "center" },
|
||||
{ TextJustifyType::Left, "left" },
|
||||
{ TextJustifyType::Right, "right" },
|
||||
|
||||
Reference in New Issue
Block a user