Sfoglia il codice sorgente

Change behavior of Math::sign to match Godot builtin

Fixes #551.
Erik Abair 4 anni fa
parent
commit
d3f17c1dca
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      include/godot_cpp/core/math.hpp

+ 1 - 1
include/godot_cpp/core/math.hpp

@@ -433,7 +433,7 @@ inline T max(T a, T b) {
 
 template <typename T>
 inline T sign(T x) {
-	return static_cast<T>(x < 0 ? -1 : 1);
+	return static_cast<T>(SIGN(x));
 }
 
 template <typename T>