Skip to content

Commit

Permalink
Fix using ImFloor() instead of IM_FLOOR().
Browse files Browse the repository at this point in the history
Macro got renamed in IMGUI_VERSION_NUM 18993. Technically old ImFloor()/IM_FLOOR() was a trunc(). New ImFloor() is an actual floor(), works with signed value, so good for position.
  • Loading branch information
ocornut committed Sep 26, 2023
1 parent 7b91715 commit 5e5e884
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions implot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,8 @@ void AddTextVertical(ImDrawList *DrawList, ImVec2 pos, ImU32 col, const char *te
ImGuiContext& g = *GImGui;
ImFont* font = g.Font;
// Align to be pixel perfect
pos.x = IM_FLOOR(pos.x);
pos.y = IM_FLOOR(pos.y);
pos.x = ImFloor(pos.x);
pos.y = ImFloor(pos.y);
const float scale = g.FontSize / font->FontSize;
const char* s = text_begin;
int chars_exp = (int)(text_end - s);
Expand Down

0 comments on commit 5e5e884

Please sign in to comment.