1
0
Fork 0
mirror of https://github.com/gwm17/implot.git synced 2024-11-23 02:38:53 -05:00

IM_NORMALIZE2F_OVER_ZERO -> IMPLOT_NORMALIZE2F_OVER_ZERO (#142)

Avoids warnings when compiling with certain compilers.
This commit is contained in:
Edvard Thörnros 2020-11-10 14:42:51 +01:00 committed by GitHub
parent 862b8c44ea
commit c942a400e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,7 +32,7 @@
#define SQRT_1_2 0.70710678118f #define SQRT_1_2 0.70710678118f
#define SQRT_3_2 0.86602540378f #define SQRT_3_2 0.86602540378f
#define IM_NORMALIZE2F_OVER_ZERO(VX, VY) \ #define IMPLOT_NORMALIZE2F_OVER_ZERO(VX, VY) \
{ \ { \
float d2 = VX * VX + VY * VY; \ float d2 = VX * VX + VY * VY; \
if (d2 > 0.0f) { \ if (d2 > 0.0f) { \
@ -426,7 +426,7 @@ struct TransformerLogLog {
inline void AddLine(const ImVec2& P1, const ImVec2& P2, float weight, ImU32 col, ImDrawList& DrawList, ImVec2 uv) { inline void AddLine(const ImVec2& P1, const ImVec2& P2, float weight, ImU32 col, ImDrawList& DrawList, ImVec2 uv) {
float dx = P2.x - P1.x; float dx = P2.x - P1.x;
float dy = P2.y - P1.y; float dy = P2.y - P1.y;
IM_NORMALIZE2F_OVER_ZERO(dx, dy); IMPLOT_NORMALIZE2F_OVER_ZERO(dx, dy);
dx *= (weight * 0.5f); dx *= (weight * 0.5f);
dy *= (weight * 0.5f); dy *= (weight * 0.5f);
DrawList._VtxWritePtr[0].pos.x = P1.x + dy; DrawList._VtxWritePtr[0].pos.x = P1.x + dy;