Commit Graph

23 Commits

Author SHA1 Message Date
Alexander Shalamov
9ba700fd47 [core] Fix combination of icon-text-fit with text-variable-anchors and text-writing-mode 2019-08-20 12:31:02 +03:00
Chris Loer
ce76bde13d [core] Initial implementation of 'format' expression 2018-10-15 13:15:46 -07:00
Lauren Budorick
2de89a99bc Implement icon-anchor property 2017-08-28 13:32:56 -07:00
Chris Loer
fd2b525c4d [core] Correct x-offset introduced by vertical glyph rotation
Fixes issue#9768.
Port of GL JS PR #5100.
2017-08-18 10:53:26 -07:00
Chris Loer
3b26177e9d [test] Fix undefined behavior warning:
quads.test.cpp used a bin with unsupported x/y coordinates.
Issue #9499.
2017-07-14 09:45:06 +02:00
Ansis Brammanis
e514138b69 [core] improve legibility of labels that follow lines
port https://github.com/mapbox/mapbox-gl-js/pull/4781

This improves legibility of labels that follow lines in pitched views.
The previous approach used the limited information in the shader to
calculate put the glyph in approximatelyright place. The new approach
does this more accurately by doing it on the cpu where we have access to
the entire line geometry.
2017-07-11 09:10:24 -07:00
John Firebaugh
0b68731207 [core] Per-bucket icon atlases 2017-06-13 10:18:43 -07:00
John Firebaugh
d766af44c8 [core] Auto-growable SpriteAtlas using shelf-pack 2017-05-26 11:21:56 -07:00
John Firebaugh
1759603e12 [core] Simplify and fix sprite atlas coordinate calculations
* Always return image metrics exclusive of padding
* Work with integer coordinates whenever possible
* Eliminate redundant SpriteAtlasElement members
* Fix asymmetric re-padding in getIconQuad when pixelRatio != 1
* Add explanatory comments
2017-05-23 12:59:27 -07:00
John Firebaugh
72b13cef6a [core] Remove unnecessary optionals in PositionedIcon
Lack of icon is already checked at the call site of shapeIcon; no need to check hasArea() here.
2017-05-23 12:59:27 -07:00
John Firebaugh
cc1ea759a6 [core, node, darwin, android, qt] Make image ID part of Image
More like Source and Layer.
2017-05-16 12:26:35 -07:00
John Firebaugh
8fb1a81c46 [core] Immutable<Impl> for Image 2017-05-15 08:20:18 -07:00
John Firebaugh
5dd98df50b [all] Rationalize style::Image
A style has a collection of images, just as it has collections of sources and layers.

* Name things appropriately
* Use std::unique_ptr
2017-04-24 15:52:28 -07:00
Bruno de Oliveira Abinader
98e2e59e5e [core] Safeguard PositionedIcon usage via optional 2017-04-14 12:33:13 -07:00
Anand Thakker
693c9f3641 [core] Add DDS support for {text,icon}-size (#8593)
* Update gl-js and generate style code

* Factor out packUint8Pair() helper function

* Draft implementation of DDS for {text,icon}-size

Ports https://github.com/mapbox/mapbox-gl-js/pull/4455

* Fix text-size/composite-function-line-placement test

* Refactor to PaintPropertyBinders-like strategy

* Dedupe gl::Program construction

* Use exponential function base for interpolation

* Dedupe coveringZoomStops method

* Fixup tests

* Fix CI errors (hidden within #if block)
2017-04-06 15:29:59 -04:00
John Firebaugh
c4f9582bfa [core] Pass fully-evaluated layout properties to SymbolInstance and quad methods 2017-03-31 13:26:27 -07:00
John Firebaugh
d7a55a4be1 [core] Introduce a fully-evaluated tuple type for layout properties 2017-03-31 13:26:27 -07:00
John Firebaugh
e18f60229e [core] There's only ever one icon quad 2017-02-28 13:59:14 -08:00
John Firebaugh
d819ece74c [core] Combine SpriteAtlas::getPosition with SpriteAtlas::getImage 2017-02-14 16:28:12 -06: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
3f3fc7b772 [test] add .test.cpp suffix to test case files 2016-09-28 16:34:22 +02:00