[core] Rationalize style property classes: <type>{Paint,Layout}Properties
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#include <mbgl/text/quads.hpp>
|
||||
#include <mbgl/text/shaping.hpp>
|
||||
#include <mbgl/geometry/anchor.hpp>
|
||||
#include <mbgl/style/style_layout.hpp>
|
||||
#include <mbgl/style/style_properties.hpp>
|
||||
#include <mbgl/util/math.hpp>
|
||||
#include <cassert>
|
||||
|
||||
@@ -9,8 +9,8 @@ namespace mbgl {
|
||||
|
||||
const float globalMinScale = 0.5f; // underscale by 1 zoom level
|
||||
|
||||
SymbolQuads getIconQuads(Anchor &anchor, const PositionedIcon &shapedIcon,
|
||||
const std::vector<Coordinate> &line, const StyleLayoutSymbol &layout,
|
||||
SymbolQuads getIconQuads(Anchor& anchor, const PositionedIcon& shapedIcon,
|
||||
const std::vector<Coordinate>& line, const SymbolLayoutProperties& layout,
|
||||
const bool alongLine) {
|
||||
|
||||
const float border = 1.0;
|
||||
@@ -128,9 +128,9 @@ void getSegmentGlyphs(std::back_insert_iterator<GlyphInstances> glyphs, Anchor &
|
||||
}
|
||||
}
|
||||
|
||||
SymbolQuads getGlyphQuads(Anchor &anchor, const Shaping &shapedText,
|
||||
const float boxScale, const std::vector<Coordinate> &line, const StyleLayoutSymbol &layout,
|
||||
const bool alongLine, const GlyphPositions &face) {
|
||||
SymbolQuads getGlyphQuads(Anchor& anchor, const Shaping& shapedText,
|
||||
const float boxScale, const std::vector<Coordinate>& line, const SymbolLayoutProperties& layout,
|
||||
const bool alongLine, const GlyphPositions& face) {
|
||||
|
||||
const float textRotate = layout.text.rotate * M_PI / 180;
|
||||
const bool keepUpright = layout.text.keep_upright;
|
||||
|
||||
@@ -33,16 +33,16 @@ namespace mbgl {
|
||||
typedef std::vector<SymbolQuad> SymbolQuads;
|
||||
|
||||
struct Anchor;
|
||||
class StyleLayoutSymbol;
|
||||
class SymbolLayoutProperties;
|
||||
class PositionedIcon;
|
||||
|
||||
SymbolQuads getIconQuads(Anchor &anchor, const PositionedIcon &shapedIcon,
|
||||
const std::vector<Coordinate> &line, const StyleLayoutSymbol &layout,
|
||||
SymbolQuads getIconQuads(Anchor& anchor, const PositionedIcon& shapedIcon,
|
||||
const std::vector<Coordinate>& line, const SymbolLayoutProperties& layout,
|
||||
const bool alongLine);
|
||||
|
||||
SymbolQuads getGlyphQuads(Anchor &anchor, const Shaping &shapedText,
|
||||
const float boxScale, const std::vector<Coordinate> &line, const StyleLayoutSymbol &layout,
|
||||
const bool alongLine, const GlyphPositions &face);
|
||||
SymbolQuads getGlyphQuads(Anchor& anchor, const Shaping& shapedText,
|
||||
const float boxScale, const std::vector<Coordinate>& line, const SymbolLayoutProperties& layout,
|
||||
const bool alongLine, const GlyphPositions& face);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#include <mbgl/text/shaping.hpp>
|
||||
#include <mbgl/style/style_layout.hpp>
|
||||
#include <mbgl/style/style_properties.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
PositionedIcon shapeIcon(const Rect<uint16_t> &image, const StyleLayoutSymbol &layout) {
|
||||
PositionedIcon shapeIcon(const Rect<uint16_t>& image, const SymbolLayoutProperties& layout) {
|
||||
float dx = layout.icon.offset[0];
|
||||
float dy = layout.icon.offset[1];
|
||||
float x1 = dx - image.originalW / 2.0f;
|
||||
|
||||
@@ -22,9 +22,9 @@ namespace mbgl {
|
||||
operator bool() const { return image.hasArea(); }
|
||||
};
|
||||
|
||||
class StyleLayoutSymbol;
|
||||
class SymbolLayoutProperties;
|
||||
|
||||
PositionedIcon shapeIcon(const Rect<uint16_t> &image, const StyleLayoutSymbol &layout);
|
||||
PositionedIcon shapeIcon(const Rect<uint16_t>& image, const SymbolLayoutProperties&);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user