Przeglądaj źródła

TextLink(), TextLinkOpenURL(): fixed honoring text baseline alignment. (#8451, #7660)

ocornut 6 miesięcy temu
rodzic
commit
c5ade6591e
2 zmienionych plików z 3 dodań i 1 usunięć
  1. 2 0
      docs/CHANGELOG.txt
  2. 1 1
      imgui_widgets.cpp

+ 2 - 0
docs/CHANGELOG.txt

@@ -99,6 +99,8 @@ Other changes:
   - Default for unselected tabs: TabCloseButtonMinWidthUnselected = 0.0f (visible when hovered)
 - Tabs: fixed middle-mouse-button to close tab not checking that close button
   is hovered, merely it's visibility. (#8399, #8387) [@nicovanbentum]
+- TextLink(), TextLinkOpenURL(): fixed honoring text baseline alignment.
+  (#8451, #7660) [@achabense]
 - TextLinkOpenURL(): fixed default Win32 io.PlatformOpenInShellFn handler to
   handle UTF-8 regardless of system regional settings. (#7660) [@achabense]
 - Debug Tools: Added io.ConfigDebugHighlightIdConflictsShowItemPicker (defaults to true)

+ 1 - 1
imgui_widgets.cpp

@@ -1444,7 +1444,7 @@ bool ImGui::TextLink(const char* label)
     const ImGuiID id = window->GetID(label);
     const char* label_end = FindRenderedTextEnd(label);
 
-    ImVec2 pos = window->DC.CursorPos;
+    ImVec2 pos(window->DC.CursorPos.x, window->DC.CursorPos.y + window->DC.CurrLineTextBaseOffset);
     ImVec2 size = CalcTextSize(label, label_end, true);
     ImRect bb(pos, pos + size);
     ItemSize(size, 0.0f);