Commit Graph

34 Commits

Author SHA1 Message Date
Anand Thakker
0abaae23b6 Small edit to improve code resiliency (#8540)
h/t @ChrisLoer catching this place where we were relying on member
initialization order.  While it _happened_ to be okay here, it's
unnecessarily fragile.
2017-03-28 07:41:03 -04:00
Chris Loer
a3f40d0c0c Verbose commenting on getSegmentGlyphs (#8361)
* Verbose commenting on getSegmentGlyphs
 This came out of @cloer and @anandthakker trying to figure out
 how getSegmentGlyphs actually worked.
 Goal is to use this commented version as the base for a refactor.

* Refactor getSegmentGlyphs for clarity.

* Add more documentation, inline helper functions

* Initialize VirtualSegments directly

* Fix virtual anchor diagram
2017-03-22 17:27:06 -04:00
John Firebaugh
e1c85e8ec3 [core] const-correction 2017-03-02 14:36:30 -08:00
John Firebaugh
a7b7f3d442 [core] Fix whitespace; no need for explicit on multi-parameter constructors 2017-03-02 14:36:30 -08:00
John Firebaugh
e18f60229e [core] There's only ever one icon quad 2017-02-28 13:59:14 -08:00
Minh Nguyễn
e6c15d0f6f Upright CJK characters in vertically-oriented labels (#7114)
CJK characters and adjacent punctuation now remain upright in vertically oriented labels that have line placement.

Fixes #1682.
2017-02-10 18:57:48 -06:00
John Firebaugh
141e995806 [core] Add support for data-driven styling 2017-02-02 09:44:42 -08:00
John Firebaugh
38fcbe21d4 [core] Convert style properties to a tuple-based approach
This converts the style property classes (CirclePaintProperties and so on) to the same tuple-based approach as gl::Attribute and gl::Uniform. The approach is outlined in https://github.com/mapbox/cpp/blob/master/C%2B%2B%20Structural%20Metaprogramming.md.

The main advantage of this approach is it allows writing algorithms that work on sets of style properties, without resorting to code generation or manually repetitive code. This lets us iterate on approaches to data-driven properties more easily.

Another advantage is that the cascading, unevaluated, and evaluated states of a set of properties exist as independent structures, instead of individual properties holding their own state. This is a more functional approach that makes data flow clearer and reduces state.
2016-11-17 15:13:38 -08:00
Konstantin Käfer
f3191dbbb4 [core] change bool *AlongLine to SymbolPlacementType 2016-09-07 17:56:38 +02:00
Young Hahn
199ea2a82a Support for icon-text-fit, icon-text-fit-padding (#5334)
* Add support for icon-text-fit

* Port unit tests for getIconQuads() from js => cpp

* Add support for padding in all 4 directions.

* Update all hashes post-merge
2016-06-15 17:13:31 -04:00
Bruno de Oliveira Abinader
4161d197fd [tidy] Check modernize-pass-by-value
Ref: http://clang.llvm.org/extra/clang-tidy/checks/modernize-pass-by-value.html
2016-06-13 23:32:05 +03:00
John Firebaugh
5c7dfd948f [core] *Tile ↔ *TileData
Tile is now the main base class; RasterTile, VectorTile, etc are its subclasses. GeometryTileData and its subclasses form the piece that's passed to the worker.
2016-06-13 10:59:33 -07:00
Young Hahn
0dee9f81f3 Don't apply textRotate twice. (#5321) 2016-06-11 12:37:28 -04:00
Young Hahn
ecd4aa1439 text-pitch-alignment (#5288)
* First pass at port of https://github.com/mapbox/mapbox-gl-js/pull/2668

* RotationAlignmentType => AlignmentType

* Handle undefined default value for text-pitch-alignment and implement inheritance for this value from text-rotation-alignment

* Update dependencies

* Move handling fo undefined default value out of camelize functions
2016-06-10 23:05:15 -04:00
John Firebaugh
c902f9098b [core] Rationalize naming for style-related code 2016-06-02 14:51:39 -07:00
John Firebaugh
a43940afb2 [core] Runtime style layer API 2016-06-02 14:51:39 -07:00
John Firebaugh
9330d674a9 [core] Use geometry.hpp's point 2016-05-05 11:30:53 -07:00
John Firebaugh
b2beeda50b [core] Adopt a strict naming convention for style properties
This will allow code to be generated from the style specification.
2016-04-21 14:05:40 -07:00
Bruno de Oliveira Abinader
f3fc87261c [core] Coordinate is now GeometryCoordinate
Also introduced GeometryCoordinates (vector of GeometryCoordinate
items), to better cope with GeometryCollection.
2016-03-01 20:58:54 +00:00
Bruno de Oliveira Abinader
411a562061 [core] Enforce constants usage
Use 'LATITUDE_MAX', 'LONGITUDE_MAX', 'DEG2RAD' and 'RAD2DEG' whenever
possible.
2016-03-01 20:58:54 +00:00
Ansis Brammanis
bdfa1277a5 [core] match icon rendering with -js
port https://github.com/mapbox/mapbox-gl-js/pull/1919/files
2016-01-13 14:48:07 -08:00
Konstantin Käfer
d5fb535058 [core] add namespace comment to closing brace 2015-12-03 15:38:36 +01:00
John Firebaugh
a562567589 [core] Eliminate use of ClassProperties for layout 2015-11-10 11:33:17 -08:00
John Firebaugh
df89de5cc5 [core] Rationalize style property classes: <type>{Paint,Layout}Properties 2015-10-22 09:21:30 -07:00
Minh Nguyễn
9482649ae5 [core] Look the other way when placing icon at start of line
When an anchor is at the beginning of a line, its segment’s coordinates match its own coordinates, resulting in an angle of 0°. When the segment’s coordinates match the anchor’s coordinates, consider the next segment instead.

Fixes #2474.
2015-10-07 14:57:58 -07:00
Ansis Brammanis
99c5976498 port minor collision code cleanup, fix #1705
https://github.com/mapbox/mapbox-gl-js/pull/1261
2015-08-24 18:41:51 -04:00
Ansis Brammanis
93fc67ba55 re-add sprite atlas pollution fix
It got missed in a merge.
03d5e2da80
2015-06-02 11:33:03 -04:00
Ansis Brammanis
fd19eb7905 fix shaped icon box sizes 2015-05-28 19:17:07 -04:00
Ansis Brammanis
7abd7950c9 Merge branch 'master' into new-labelling
Conflicts:
	src/mbgl/map/tile_parser.cpp
	src/mbgl/map/tile_parser.hpp
	src/mbgl/renderer/painter.hpp
	src/mbgl/renderer/painter_symbol.cpp
	src/mbgl/renderer/symbol_bucket.cpp
	src/mbgl/renderer/symbol_bucket.hpp
	src/mbgl/text/collision.cpp
	src/mbgl/text/collision.hpp
	src/mbgl/text/placement.cpp
2015-05-19 11:09:33 -04:00
Ansis Brammanis
7ac01660d7 port line icon angle fix
-js: 37a498a7aa2c37d6b94611b614b4efe134e6dd59
2015-04-09 12:17:43 -07:00
Ansis Brammanis
68ae21d8f4 fix android and Release builds 2015-04-02 13:33:50 -07:00
Ansis Brammanis
02d2ddef52 fix quad offsets by subtracting buffer
-js doesn't have this here because it subtracts the buffer earlier.
617e590c83/js/symbol/glyph_source.js (L75)

We should match -js eventually.
2015-04-02 12:39:30 -07:00
Ansis Brammanis
7b02800ad9 remove old symbol collision types 2015-04-02 12:16:42 -07:00
Ansis Brammanis
9309f59de3 split generating symbol quads from collision code
Collision prevention is temporarily disabled.
2015-03-31 15:33:57 -07:00