-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Conversation
19df93a
to
c6f2cc7
Compare
c6f2cc7
to
ef803e1
Compare
ef803e1
to
9b1def0
Compare
namespace { | ||
|
||
} // namespace | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove unused?
src/mbgl/text/shaping.cpp
Outdated
@@ -360,12 +363,10 @@ const Shaping getShaping(const TaggedString& formattedString, | |||
const style::TextJustifyType textJustify, | |||
const float spacing, | |||
const Point<float>& translate, | |||
const float verticalHeight, | |||
//const float verticalHeight, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
/cc @fabian-guerra for related |
@alexshalamov @kkaefer Thanks for your comments! Fixed now in the latest patch set. Also, an optimization for single-line labels is added. |
@pozdnyakov - does the implementation in this PR still leave out runtime styling support? |
This patch contains auto-generated runtime API & tests for Android. |
// but doesn't actually specify what happens if you use both. We go with the radial offset. | ||
textOffset = evaluateRadialOffset(textAnchor, radialOffset * util::ONE_EM); | ||
} else { | ||
textOffset = { layout.evaluate<TextOffset>(zoom, feature)[0] * util::ONE_EM, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const auto evaluatedOffset = layout.evaluate<TextOffset>(zoom, feature);
textOffset = { evaluatedOffset[0] * util::ONE_EM, evaluatedOffset[1] * util::ONE_EM };
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pozdnyakov wdyt? simple fix, avoids extra evaluation of text offset.
@@ -197,7 +197,12 @@ global.defaultValueJava = function(property) { | |||
case 'array': | |||
switch (property.value) { | |||
case 'string': | |||
return '[' + property['default'] + "]"; | |||
case 'enum': | |||
if (property['default'] !== undefined) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change has to be applied to darwin/scripts/generate-style-code.js
and please run make darwin-style-code
after. That's why the iOS and macOS tests fail in this branch.
Let me know if you have any questions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a bit more than this, pls see 9bc4994
auto str = mbgl::Enum<MBGLEnum>::toString(value); | ||
MGLEnum mglType = *mbgl::Enum<MGLEnum>::toEnum(str); | ||
return [NSValue value:&mglType withObjCType:@encode(MGLEnum)]; | ||
static NSString *toMGLRawStyleValue(const MBGLEnum &value) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we changing NSValue
to an NSString
? Is there any MGLTextAnchor
conversion error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previously existing method was never invoked - the currently removed
template <typename MBGLEnum = MBGLType,
class = typename std::enable_if<std::is_enum<MBGLEnum>::value>::type,
typename MGLEnum = ObjCEnum,
class = typename std::enable_if<std::is_enum<MGLEnum>::value>::type>
NSExpression *operator()(const MBGLEnum &value) const {...}
was used instead. It worked fine for a single MGLTextAnchor
instance, however std::vector< MGLTextAnchor>
could not be handled.
|
||
You can set this property to an expression containing any of the following: | ||
|
||
* Constant array values |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is accepts MGLTextAnchor
values, the documentation should be similar to:
mapbox-gl-native/platform/darwin/src/MGLSymbolStyleLayer.h
Lines 1145 to 1159 in 0ec8945
* Constant `MGLTextAnchor` values | |
* Any of the following constant string values: | |
* `center`: The center of the text is placed closest to the anchor. | |
* `left`: The left side of the text is placed closest to the anchor. | |
* `right`: The right side of the text is placed closest to the anchor. | |
* `top`: The top of the text is placed closest to the anchor. | |
* `bottom`: The bottom of the text is placed closest to the anchor. | |
* `top-left`: The top left corner of the text is placed closest to the | |
anchor. | |
* `top-right`: The top right corner of the text is placed closest to the | |
anchor. | |
* `bottom-left`: The bottom left corner of the text is placed closest to the | |
anchor. | |
* `bottom-right`: The bottom right corner of the text is placed closest to | |
the anchor. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Port of mapbox/mapbox-gl-js#7596