Skip to content

Commit

Permalink
mapbox-gl-native: fix build
Browse files Browse the repository at this point in the history
Pull request submitted upstream:
mapbox/mapbox-gl-native#16666
  • Loading branch information
Thra11 committed May 9, 2023
1 parent de62c56 commit 762c3a9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From 2955d0e479f57a39a0af4a0fa7ca7683455cca58 Mon Sep 17 00:00:00 2001
From: Tom Hall <tahall256@protonmail.ch>
Date: Tue, 9 May 2023 23:17:28 +0100
Subject: [PATCH] Fix narrowing conversion warning/error

---
src/mbgl/layout/symbol_projection.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mbgl/layout/symbol_projection.cpp b/src/mbgl/layout/symbol_projection.cpp
index eecaced82..fef602aa4 100644
--- a/src/mbgl/layout/symbol_projection.cpp
+++ b/src/mbgl/layout/symbol_projection.cpp
@@ -95,7 +95,7 @@ namespace mbgl {
PointAndCameraDistance project(const Point<float>& point, const mat4& matrix) {
vec4 pos = {{ point.x, point.y, 0, 1 }};
matrix::transformMat4(pos, pos, matrix);
- return {{ static_cast<float>(pos[0] / pos[3]), static_cast<float>(pos[1] / pos[3]) }, pos[3] };
+ return {{ static_cast<float>(pos[0] / pos[3]), static_cast<float>(pos[1] / pos[3]) }, static_cast<float>(pos[3]) };
}

float evaluateSizeForFeature(const ZoomEvaluatedSize& zoomEvaluatedSize, const PlacedSymbol& placedSymbol) {
--
2.39.2

1 change: 1 addition & 0 deletions pkgs/development/libraries/mapbox-gl-native/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ mkDerivation rec {
url = "https://aur.archlinux.org/cgit/aur.git/plain/fix-compilation.patch?h=mapbox-gl-native";
hash = "sha256-KgJHyoIdKdnQo+gedns3C+mEXlaTH/UtyQsaYR1T3iI=";
})
./0001-Fix-narrowing-conversion-warning-error.patch
];

postPatch = ''
Expand Down

0 comments on commit 762c3a9

Please sign in to comment.