[core] Store 'sdf' flag in vertex attribute
This commit is contained in:
@@ -26,13 +26,15 @@ SymbolInstanceSharedData::SymbolInstanceSharedData(GeometryCoordinates line_,
|
||||
const style::SymbolPlacementType textPlacement,
|
||||
const std::array<float, 2>& textOffset,
|
||||
const ImageMap& imageMap,
|
||||
SymbolContent iconType,
|
||||
bool allowVerticalPlacement)
|
||||
: line(std::move(line_)) {
|
||||
// Create the quads used for rendering the icon and glyphs.
|
||||
if (shapedIcon) {
|
||||
iconQuad = getIconQuad(*shapedIcon, getAnyShaping(shapedTextOrientations).writingMode);
|
||||
iconQuad = getIconQuad(*shapedIcon, getAnyShaping(shapedTextOrientations).writingMode, iconType);
|
||||
if (verticallyShapedIcon) {
|
||||
verticalIconQuad = getIconQuad(*verticallyShapedIcon, shapedTextOrientations.vertical.writingMode);
|
||||
verticalIconQuad =
|
||||
getIconQuad(*verticallyShapedIcon, shapedTextOrientations.vertical.writingMode, iconType);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,8 @@ struct ShapedTextOrientations {
|
||||
bool singleLine = false;
|
||||
};
|
||||
|
||||
enum class SymbolContent : uint8_t { None = 0, Text = 1 << 0, IconRGBA = 1 << 1, IconSDF = 1 << 2 };
|
||||
|
||||
struct SymbolInstanceSharedData {
|
||||
SymbolInstanceSharedData(GeometryCoordinates line,
|
||||
const ShapedTextOrientations& shapedTextOrientations,
|
||||
@@ -30,6 +32,7 @@ struct SymbolInstanceSharedData {
|
||||
const style::SymbolPlacementType textPlacement,
|
||||
const std::array<float, 2>& textOffset,
|
||||
const ImageMap& imageMap,
|
||||
SymbolContent iconType,
|
||||
bool allowVerticalPlacement);
|
||||
bool empty() const;
|
||||
GeometryCoordinates line;
|
||||
@@ -42,13 +45,6 @@ struct SymbolInstanceSharedData {
|
||||
optional<SymbolQuad> verticalIconQuad;
|
||||
};
|
||||
|
||||
enum class SymbolContent : uint8_t {
|
||||
None = 0,
|
||||
Text = 1 << 0,
|
||||
IconRGBA = 1 << 1,
|
||||
IconSDF = 1 << 2
|
||||
};
|
||||
|
||||
class SymbolInstance {
|
||||
public:
|
||||
SymbolInstance(Anchor& anchor_,
|
||||
|
||||
@@ -597,6 +597,7 @@ void SymbolLayout::addFeature(const std::size_t layoutFeatureIndex,
|
||||
textPlacement,
|
||||
textOffset,
|
||||
imageMap,
|
||||
iconType,
|
||||
allowVerticalPlacement);
|
||||
};
|
||||
|
||||
@@ -864,10 +865,14 @@ size_t SymbolLayout::addSymbol(SymbolBucket::Buffer& buffer,
|
||||
uint16_t index = segment.vertexLength;
|
||||
|
||||
// coordinates (2 triangles)
|
||||
buffer.vertices.emplace_back(SymbolSDFIconProgram::layoutVertex(labelAnchor.point, tl, symbol.glyphOffset.y, tex.x, tex.y, sizeData));
|
||||
buffer.vertices.emplace_back(SymbolSDFIconProgram::layoutVertex(labelAnchor.point, tr, symbol.glyphOffset.y, tex.x + tex.w, tex.y, sizeData));
|
||||
buffer.vertices.emplace_back(SymbolSDFIconProgram::layoutVertex(labelAnchor.point, bl, symbol.glyphOffset.y, tex.x, tex.y + tex.h, sizeData));
|
||||
buffer.vertices.emplace_back(SymbolSDFIconProgram::layoutVertex(labelAnchor.point, br, symbol.glyphOffset.y, tex.x + tex.w, tex.y + tex.h, sizeData));
|
||||
buffer.vertices.emplace_back(SymbolSDFIconProgram::layoutVertex(
|
||||
labelAnchor.point, tl, symbol.glyphOffset.y, tex.x, tex.y, sizeData, symbol.isSDF));
|
||||
buffer.vertices.emplace_back(SymbolSDFIconProgram::layoutVertex(
|
||||
labelAnchor.point, tr, symbol.glyphOffset.y, tex.x + tex.w, tex.y, sizeData, symbol.isSDF));
|
||||
buffer.vertices.emplace_back(SymbolSDFIconProgram::layoutVertex(
|
||||
labelAnchor.point, bl, symbol.glyphOffset.y, tex.x, tex.y + tex.h, sizeData, symbol.isSDF));
|
||||
buffer.vertices.emplace_back(SymbolSDFIconProgram::layoutVertex(
|
||||
labelAnchor.point, br, symbol.glyphOffset.y, tex.x + tex.w, tex.y + tex.h, sizeData, symbol.isSDF));
|
||||
|
||||
// Dynamic/Opacity vertices are initialized so that the vertex count always agrees with
|
||||
// the layout vertex buffer, but they will always be updated before rendering happens
|
||||
|
||||
@@ -14,12 +14,15 @@
|
||||
#include <mbgl/style/layers/symbol_layer_impl.hpp>
|
||||
#include <mbgl/renderer/layers/render_symbol_layer.hpp>
|
||||
|
||||
|
||||
#include <cmath>
|
||||
#include <array>
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
const uint16_t MAX_GLYPH_ICON_SIZE = 255;
|
||||
const uint16_t SIZE_PACK_FACTOR = 128;
|
||||
const uint16_t MAX_PACKED_SIZE = MAX_GLYPH_ICON_SIZE * SIZE_PACK_FACTOR;
|
||||
|
||||
namespace style {
|
||||
class SymbolPropertyValues;
|
||||
} // namespace style
|
||||
@@ -197,26 +200,21 @@ public:
|
||||
class SymbolProgramBase {
|
||||
public:
|
||||
static gfx::Vertex<SymbolLayoutAttributes> layoutVertex(Point<float> labelAnchor,
|
||||
Point<float> o,
|
||||
float glyphOffsetY,
|
||||
uint16_t tx,
|
||||
uint16_t ty,
|
||||
const Range<float>& sizeData) {
|
||||
Point<float> o,
|
||||
float glyphOffsetY,
|
||||
uint16_t tx,
|
||||
uint16_t ty,
|
||||
const Range<float>& sizeData,
|
||||
bool isSDF) {
|
||||
const uint16_t aSizeMin = (std::min(MAX_PACKED_SIZE, static_cast<uint16_t>(sizeData.min * SIZE_PACK_FACTOR)) << 1) + uint16_t(isSDF);
|
||||
const uint16_t aSizeMax = std::min(MAX_PACKED_SIZE, static_cast<uint16_t>(sizeData.max * SIZE_PACK_FACTOR));
|
||||
return {
|
||||
// combining pos and offset to reduce number of vertex attributes passed to shader (8 max for some devices)
|
||||
{{
|
||||
static_cast<int16_t>(labelAnchor.x),
|
||||
static_cast<int16_t>(labelAnchor.y),
|
||||
static_cast<int16_t>(::round(o.x * 32)), // use 1/32 pixels for placement
|
||||
static_cast<int16_t>(::round((o.y + glyphOffsetY) * 32))
|
||||
}},
|
||||
{{
|
||||
tx,
|
||||
ty,
|
||||
static_cast<uint16_t>(sizeData.min * 256),
|
||||
static_cast<uint16_t>(sizeData.max * 256)
|
||||
}}
|
||||
};
|
||||
{{static_cast<int16_t>(labelAnchor.x),
|
||||
static_cast<int16_t>(labelAnchor.y),
|
||||
static_cast<int16_t>(::round(o.x * 32)), // use 1/32 pixels for placement
|
||||
static_cast<int16_t>(::round((o.y + glyphOffsetY) * 32))}},
|
||||
{{tx, ty, aSizeMin, aSizeMax}}};
|
||||
}
|
||||
|
||||
static gfx::Vertex<SymbolDynamicLayoutAttributes> dynamicLayoutVertex(Point<float> anchorPoint, float labelAngle) {
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
#include <mbgl/geometry/anchor.hpp>
|
||||
#include <mbgl/layout/symbol_instance.hpp>
|
||||
#include <mbgl/style/layers/symbol_layer_properties.hpp>
|
||||
#include <mbgl/text/quads.hpp>
|
||||
#include <mbgl/text/shaping.hpp>
|
||||
#include <mbgl/tile/geometry_tile_data.hpp>
|
||||
#include <mbgl/geometry/anchor.hpp>
|
||||
#include <mbgl/style/layers/symbol_layer_properties.hpp>
|
||||
#include <mbgl/util/math.hpp>
|
||||
#include <mbgl/util/constants.hpp>
|
||||
#include <mbgl/util/math.hpp>
|
||||
#include <mbgl/util/optional.hpp>
|
||||
|
||||
#include <cassert>
|
||||
@@ -13,8 +14,7 @@ namespace mbgl {
|
||||
|
||||
using namespace style;
|
||||
|
||||
SymbolQuad getIconQuad(const PositionedIcon& shapedIcon,
|
||||
WritingModeType writingMode) {
|
||||
SymbolQuad getIconQuad(const PositionedIcon& shapedIcon, WritingModeType writingMode, SymbolContent iconType) {
|
||||
const ImagePosition& image = shapedIcon.image();
|
||||
|
||||
// If you have a 10px icon that isn't perfectly aligned to the pixel grid it will cover 11 actual
|
||||
@@ -70,7 +70,7 @@ SymbolQuad getIconQuad(const PositionedIcon& shapedIcon,
|
||||
static_cast<uint16_t>(image.textureRect.h + border * 2)
|
||||
};
|
||||
|
||||
return SymbolQuad { tl, tr, bl, br, textureRect, writingMode, { 0.0f, 0.0f } };
|
||||
return SymbolQuad{tl, tr, bl, br, textureRect, writingMode, {0.0f, 0.0f}, iconType == SymbolContent::IconSDF};
|
||||
}
|
||||
|
||||
SymbolQuads getGlyphQuads(const Shaping& shapedText,
|
||||
@@ -96,6 +96,7 @@ SymbolQuads getGlyphQuads(const Shaping& shapedText,
|
||||
const bool rotateVerticalGlyph = (alongLine || allowVerticalPlacement) && positionedGlyph.vertical;
|
||||
const float halfAdvance = positionedGlyph.metrics.advance * positionedGlyph.scale / 2.0;
|
||||
const Rect<uint16_t>& rect = positionedGlyph.rect;
|
||||
bool isSDF = true;
|
||||
|
||||
// Align images and scaled glyphs in the middle of a vertical line.
|
||||
if (allowVerticalPlacement && shapedText.verticalizable) {
|
||||
@@ -111,6 +112,7 @@ SymbolQuads getGlyphQuads(const Shaping& shapedText,
|
||||
}
|
||||
pixelRatio = image->second->pixelRatio;
|
||||
rectBuffer = ImagePosition::padding / pixelRatio;
|
||||
isSDF = image->second->sdf;
|
||||
}
|
||||
|
||||
const Point<float> glyphOffset =
|
||||
@@ -179,7 +181,8 @@ SymbolQuads getGlyphQuads(const Shaping& shapedText,
|
||||
br = util::matrixMultiply(matrix, br);
|
||||
}
|
||||
|
||||
quads.emplace_back(tl, tr, bl, br, rect, shapedText.writingMode, glyphOffset, positionedGlyph.sectionIndex);
|
||||
quads.emplace_back(
|
||||
tl, tr, bl, br, rect, shapedText.writingMode, glyphOffset, isSDF, positionedGlyph.sectionIndex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace mbgl {
|
||||
|
||||
class Anchor;
|
||||
class PositionedIcon;
|
||||
enum class SymbolContent : uint8_t;
|
||||
|
||||
class SymbolQuad {
|
||||
public:
|
||||
@@ -22,6 +23,7 @@ public:
|
||||
Rect<uint16_t> tex_,
|
||||
WritingModeType writingMode_,
|
||||
Point<float> glyphOffset_,
|
||||
bool isSDF_,
|
||||
size_t sectionIndex_ = 0)
|
||||
: tl(tl_),
|
||||
tr(tr_),
|
||||
@@ -30,6 +32,7 @@ public:
|
||||
tex(tex_),
|
||||
writingMode(writingMode_),
|
||||
glyphOffset(glyphOffset_),
|
||||
isSDF(isSDF_),
|
||||
sectionIndex(sectionIndex_) {}
|
||||
|
||||
Point<float> tl;
|
||||
@@ -39,13 +42,13 @@ public:
|
||||
Rect<uint16_t> tex;
|
||||
WritingModeType writingMode;
|
||||
Point<float> glyphOffset;
|
||||
bool isSDF;
|
||||
size_t sectionIndex;
|
||||
};
|
||||
|
||||
using SymbolQuads = std::vector<SymbolQuad>;
|
||||
|
||||
SymbolQuad getIconQuad(const PositionedIcon& shapedIcon,
|
||||
WritingModeType writingMode);
|
||||
SymbolQuad getIconQuad(const PositionedIcon& shapedIcon, WritingModeType writingMode, SymbolContent iconType);
|
||||
|
||||
SymbolQuads getGlyphQuads(const Shaping& shapedText,
|
||||
const std::array<float, 2> textOffset,
|
||||
|
||||
@@ -16,8 +16,16 @@ SymbolInstance makeSymbolInstance(float x, float y, std::u16string key) {
|
||||
std::array<float, 2> variableTextOffset{{0.0f, 0.0f}};
|
||||
style::SymbolPlacementType placementType = style::SymbolPlacementType::Point;
|
||||
|
||||
auto sharedData = std::make_shared<SymbolInstanceSharedData>(
|
||||
std::move(line), shaping, nullopt, nullopt, layout_, placementType, textOffset, imageMap, false);
|
||||
auto sharedData = std::make_shared<SymbolInstanceSharedData>(std::move(line),
|
||||
shaping,
|
||||
nullopt,
|
||||
nullopt,
|
||||
layout_,
|
||||
placementType,
|
||||
textOffset,
|
||||
imageMap,
|
||||
SymbolContent::IconSDF,
|
||||
false);
|
||||
return SymbolInstance(anchor, std::move(sharedData), shaping, nullopt, nullopt, 0, 0, placementType, textOffset, 0, 0, iconOffset, subfeature, 0, 0, key, 0.0f, 0.0f, 0.0f, variableTextOffset, false);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
#include <mbgl/geometry/anchor.hpp>
|
||||
#include <mbgl/layout/symbol_instance.hpp>
|
||||
#include <mbgl/style/image_impl.hpp>
|
||||
#include <mbgl/style/layers/symbol_layer_properties.hpp>
|
||||
#include <mbgl/test/util.hpp>
|
||||
#include <mbgl/text/glyph.hpp>
|
||||
#include <mbgl/text/quads.hpp>
|
||||
#include <mbgl/text/shaping.hpp>
|
||||
#include <mbgl/text/glyph.hpp>
|
||||
#include <mbgl/style/layers/symbol_layer_properties.hpp>
|
||||
|
||||
using namespace mbgl;
|
||||
using namespace mbgl::style;
|
||||
@@ -21,8 +22,7 @@ TEST(getIconQuads, normal) {
|
||||
|
||||
GeometryCoordinates line;
|
||||
|
||||
SymbolQuad quad =
|
||||
getIconQuad(shapedIcon, WritingModeType::Horizontal);
|
||||
SymbolQuad quad = getIconQuad(shapedIcon, WritingModeType::Horizontal, SymbolContent::IconRGBA);
|
||||
|
||||
EXPECT_EQ(quad.tl.x, -14);
|
||||
EXPECT_EQ(quad.tl.y, -10);
|
||||
@@ -60,7 +60,7 @@ TEST(getIconQuads, style) {
|
||||
EXPECT_FLOAT_EQ(-18.5f, shapedIcon.left());
|
||||
|
||||
SymbolLayoutProperties::Evaluated layout;
|
||||
SymbolQuad quad = getIconQuad(shapedIcon, WritingModeType::Horizontal);
|
||||
SymbolQuad quad = getIconQuad(shapedIcon, WritingModeType::Horizontal, SymbolContent::IconRGBA);
|
||||
|
||||
EXPECT_FLOAT_EQ(quad.tl.x, -19.5);
|
||||
EXPECT_FLOAT_EQ(quad.tl.y, -19.5);
|
||||
@@ -76,7 +76,7 @@ TEST(getIconQuads, style) {
|
||||
{
|
||||
auto shapedIcon = PositionedIcon::shapeIcon(image, {{-9.5f, -9.5f}}, SymbolAnchorType::Center, 0);
|
||||
shapedIcon.fitIconToText(shapedText, IconTextFitType::Width, {{0, 0, 0, 0}}, {{0, 0}}, 24.0f / 24.0f);
|
||||
SymbolQuad quad = getIconQuad(shapedIcon, WritingModeType::Horizontal);
|
||||
SymbolQuad quad = getIconQuad(shapedIcon, WritingModeType::Horizontal, SymbolContent::IconRGBA);
|
||||
|
||||
EXPECT_FLOAT_EQ(quad.tl.x, -64.4444427);
|
||||
EXPECT_FLOAT_EQ(quad.tl.y, 0);
|
||||
@@ -92,7 +92,7 @@ TEST(getIconQuads, style) {
|
||||
{
|
||||
auto shapedIcon = PositionedIcon::shapeIcon(image, {{-9.5f, -9.5f}}, SymbolAnchorType::Center, 0);
|
||||
shapedIcon.fitIconToText(shapedText, IconTextFitType::Width, {{0, 0, 0, 0}}, {{0, 0}}, 12.0f / 24.0f);
|
||||
SymbolQuad quad = getIconQuad(shapedIcon, WritingModeType::Horizontal);
|
||||
SymbolQuad quad = getIconQuad(shapedIcon, WritingModeType::Horizontal, SymbolContent::IconRGBA);
|
||||
|
||||
EXPECT_FLOAT_EQ(quad.tl.x, -32.2222214);
|
||||
EXPECT_FLOAT_EQ(quad.tl.y, -5);
|
||||
@@ -108,7 +108,7 @@ TEST(getIconQuads, style) {
|
||||
{
|
||||
auto shapedIcon = PositionedIcon::shapeIcon(image, {{-9.5f, -9.5f}}, SymbolAnchorType::Center, 0);
|
||||
shapedIcon.fitIconToText(shapedText, IconTextFitType::Width, {{5, 10, 5, 10}}, {{0, 0}}, 12.0f / 24.0f);
|
||||
SymbolQuad quad = getIconQuad(shapedIcon, WritingModeType::Horizontal);
|
||||
SymbolQuad quad = getIconQuad(shapedIcon, WritingModeType::Horizontal, SymbolContent::IconRGBA);
|
||||
|
||||
EXPECT_FLOAT_EQ(quad.tl.x, -43.3333321);
|
||||
EXPECT_FLOAT_EQ(quad.tl.y, -5);
|
||||
@@ -124,7 +124,7 @@ TEST(getIconQuads, style) {
|
||||
{
|
||||
auto shapedIcon = PositionedIcon::shapeIcon(image, {{-9.5f, -9.5f}}, SymbolAnchorType::Center, 0);
|
||||
shapedIcon.fitIconToText(shapedText, IconTextFitType::Height, {{0, 0, 0, 0}}, {{0, 0}}, 24.0f / 24.0f);
|
||||
SymbolQuad quad = getIconQuad(shapedIcon, WritingModeType::Horizontal);
|
||||
SymbolQuad quad = getIconQuad(shapedIcon, WritingModeType::Horizontal, SymbolContent::IconRGBA);
|
||||
|
||||
EXPECT_FLOAT_EQ(quad.tl.x, -30);
|
||||
EXPECT_FLOAT_EQ(quad.tl.y, -12.2222214);
|
||||
@@ -141,7 +141,7 @@ TEST(getIconQuads, style) {
|
||||
SymbolLayoutProperties::Evaluated layout;
|
||||
auto shapedIcon = PositionedIcon::shapeIcon(image, {{-9.5f, -9.5f}}, SymbolAnchorType::Center, 0);
|
||||
shapedIcon.fitIconToText(shapedText, IconTextFitType::Height, {{0, 0, 0, 0}}, {{0, 0}}, 12.0f / 24.0f);
|
||||
SymbolQuad quad = getIconQuad(shapedIcon, WritingModeType::Horizontal);
|
||||
SymbolQuad quad = getIconQuad(shapedIcon, WritingModeType::Horizontal, SymbolContent::IconRGBA);
|
||||
|
||||
EXPECT_FLOAT_EQ(quad.tl.x, -20);
|
||||
EXPECT_FLOAT_EQ(quad.tl.y, -6.11111069);
|
||||
@@ -157,7 +157,7 @@ TEST(getIconQuads, style) {
|
||||
{
|
||||
auto shapedIcon = PositionedIcon::shapeIcon(image, {{-9.5f, -9.5f}}, SymbolAnchorType::Center, 0);
|
||||
shapedIcon.fitIconToText(shapedText, IconTextFitType::Height, {{5, 10, 5, 20}}, {{0, 0}}, 12.0f / 24.0f);
|
||||
SymbolQuad quad = getIconQuad(shapedIcon, WritingModeType::Horizontal);
|
||||
SymbolQuad quad = getIconQuad(shapedIcon, WritingModeType::Horizontal, SymbolContent::IconRGBA);
|
||||
|
||||
EXPECT_FLOAT_EQ(quad.tl.x, -20);
|
||||
EXPECT_FLOAT_EQ(quad.tl.y, -11.666666);
|
||||
@@ -173,7 +173,7 @@ TEST(getIconQuads, style) {
|
||||
{
|
||||
auto shapedIcon = PositionedIcon::shapeIcon(image, {{-9.5f, -9.5f}}, SymbolAnchorType::Center, 0);
|
||||
shapedIcon.fitIconToText(shapedText, IconTextFitType::Both, {{0, 0, 0, 0}}, {{0, 0}}, 24.0f / 24.0f);
|
||||
SymbolQuad quad = getIconQuad(shapedIcon, WritingModeType::Horizontal);
|
||||
SymbolQuad quad = getIconQuad(shapedIcon, WritingModeType::Horizontal, SymbolContent::IconRGBA);
|
||||
|
||||
EXPECT_FLOAT_EQ(quad.tl.x, -64.4444427);
|
||||
EXPECT_FLOAT_EQ(quad.tl.y, -12.2222214);
|
||||
@@ -189,7 +189,7 @@ TEST(getIconQuads, style) {
|
||||
{
|
||||
auto shapedIcon = PositionedIcon::shapeIcon(image, {{-9.5f, -9.5f}}, SymbolAnchorType::Center, 0);
|
||||
shapedIcon.fitIconToText(shapedText, IconTextFitType::Both, {{0, 0, 0, 0}}, {{0, 0}}, 12.0f / 24.0f);
|
||||
SymbolQuad quad = getIconQuad(shapedIcon, WritingModeType::Horizontal);
|
||||
SymbolQuad quad = getIconQuad(shapedIcon, WritingModeType::Horizontal, SymbolContent::IconRGBA);
|
||||
|
||||
EXPECT_FLOAT_EQ(quad.tl.x, -32.2222214);
|
||||
EXPECT_FLOAT_EQ(quad.tl.y, -6.11111069);
|
||||
@@ -205,7 +205,7 @@ TEST(getIconQuads, style) {
|
||||
{
|
||||
auto shapedIcon = PositionedIcon::shapeIcon(image, {{-9.5f, -9.5f}}, SymbolAnchorType::Center, 0);
|
||||
shapedIcon.fitIconToText(shapedText, IconTextFitType::Both, {{5, 10, 5, 10}}, {{0, 0}}, 12.0f / 24.0f);
|
||||
SymbolQuad quad = getIconQuad(shapedIcon, WritingModeType::Horizontal);
|
||||
SymbolQuad quad = getIconQuad(shapedIcon, WritingModeType::Horizontal, SymbolContent::IconRGBA);
|
||||
|
||||
EXPECT_FLOAT_EQ(quad.tl.x, -43.3333321);
|
||||
EXPECT_FLOAT_EQ(quad.tl.y, -11.666666);
|
||||
@@ -223,7 +223,7 @@ TEST(getIconQuads, style) {
|
||||
layout.get<TextSize>() = 12.0f;
|
||||
auto shapedIcon = PositionedIcon::shapeIcon(image, {{-9.5f, -9.5f}}, SymbolAnchorType::Center, 0);
|
||||
shapedIcon.fitIconToText(shapedText, IconTextFitType::Both, {{0, 5, 10, 15}}, {{0, 0}}, 12.0f / 24.0f);
|
||||
SymbolQuad quad = getIconQuad(shapedIcon, WritingModeType::Horizontal);
|
||||
SymbolQuad quad = getIconQuad(shapedIcon, WritingModeType::Horizontal, SymbolContent::IconRGBA);
|
||||
|
||||
EXPECT_FLOAT_EQ(quad.tl.x, -48.3333321);
|
||||
EXPECT_FLOAT_EQ(quad.tl.y, -6.66666603);
|
||||
|
||||
Reference in New Issue
Block a user