diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2014-08-04 18:46:43 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2014-08-04 18:46:43 +0200 |
commit | 056b4a988c1bc68399cc15bf2860a71f7ef068be (patch) | |
tree | 720d03c4a2e19154ed094d1844b7623e3fc33ae6 /src | |
parent | 36181b0922bf4b5bed5b5ca68679338d22dfcf31 (diff) | |
download | qtlocation-mapboxgl-056b4a988c1bc68399cc15bf2860a71f7ef068be.tar.gz |
fix boolean operators
Diffstat (limited to 'src')
-rw-r--r-- | src/renderer/symbol_bucket.cpp | 2 | ||||
-rw-r--r-- | src/text/collision.cpp | 6 | ||||
-rw-r--r-- | src/text/placement.cpp | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/renderer/symbol_bucket.cpp b/src/renderer/symbol_bucket.cpp index f165515aff..2009fe3647 100644 --- a/src/renderer/symbol_bucket.cpp +++ b/src/renderer/symbol_bucket.cpp @@ -31,7 +31,7 @@ bool SymbolBucket::hasData() const { return hasTextData() || hasIconData(); } bool SymbolBucket::hasTextData() const { return !text.groups.empty(); } -bool SymbolBucket::hasIconData() const { return !icon.groups.empty() > 0; } +bool SymbolBucket::hasIconData() const { return !icon.groups.empty(); } void SymbolBucket::addGlyphsToAtlas(uint64_t tileid, const std::string stackname, const std::u32string &string, const FontStack &fontStack, diff --git a/src/text/collision.cpp b/src/text/collision.cpp index 70712f0651..aa4cf1c7a2 100644 --- a/src/text/collision.cpp +++ b/src/text/collision.cpp @@ -112,7 +112,7 @@ float Collision::getPlacementScale(const GlyphBoxes &glyphs, float minPlacementS const float pad = glyph.padding; if (anchor.x < 0 || anchor.x > 4096 || anchor.y < 0 || anchor.y > 4096) { - return -1; + return 0; } float minScale = std::fmax(minPlacementScale, glyph.minScale); @@ -142,7 +142,7 @@ float Collision::getPlacementScale(const GlyphBoxes &glyphs, float minPlacementS // NOTE: this isn't right because there can be glyphs with // the same anchor but differing box offsets. if (na == oa) { - return -1; + return 0; } // todo: unhardcode the 8 = tileExtent/tileSize @@ -175,7 +175,7 @@ float Collision::getPlacementScale(const GlyphBoxes &glyphs, float minPlacementS } if (minPlacementScale > maxPlacementScale) { - return -1; + return 0; } } } diff --git a/src/text/placement.cpp b/src/text/placement.cpp index 448b892934..23e2a0ee87 100644 --- a/src/text/placement.cpp +++ b/src/text/placement.cpp @@ -225,7 +225,7 @@ Placement Placement::getGlyphs(Anchor &anchor, const vec2<float> &origin, const if (!glyph) continue; - if (!(rect && rect.w > 0 && rect.h > 0)) + if (!rect) continue; const float x = (origin.x + shape.x + glyph.metrics.left - buffer + rect.w / 2) * boxScale; |