Browse Source

ImDrawList: Added GetClipRectMin(), GetClipRectMax() helpers. Comments.

omar 8 years ago
parent
commit
9b484d24cd
2 changed files with 3 additions and 1 deletions
  1. 1 1
      TODO.txt
  2. 2 0
      imgui.h

+ 1 - 1
TODO.txt

@@ -26,7 +26,7 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
  - window: expose contents size. (#1045)
  - window: GetWindowSize() returns (0,0) when not calculated? (#1045)
 !- scrolling: allow immediately effective change of scroll after Begin() if we haven't appended items yet.
- - scrolling/clipping: separator on the initial position of a window is not visible (cursorpos.y <= clippos.y)
+ - scrolling/clipping: separator on the initial position of a window is not visible (cursorpos.y <= clippos.y). (2017-08-20: can't repro)
 
  - drawlist: move Font, FontSize, FontTexUvWhitePixel inside ImDrawList and make it self-contained (apart from drawing settings?)
  - drawlist: make it easier to toggle AA per primitive, so we can use e.g. non-AA fill + AA borders more naturally

+ 2 - 0
imgui.h

@@ -1233,6 +1233,8 @@ struct ImDrawList
     IMGUI_API void  PopClipRect();
     IMGUI_API void  PushTextureID(const ImTextureID& texture_id);
     IMGUI_API void  PopTextureID();
+    inline ImVec2   GetClipRectMin() const { const ImVec4& cr = _ClipRectStack.back(); return ImVec2(cr.x, cr.y); }
+    inline ImVec2   GetClipRectMax() const { const ImVec4& cr = _ClipRectStack.back(); return ImVec2(cr.z, cr.w); }
 
     // Primitives
     IMGUI_API void  AddLine(const ImVec2& a, const ImVec2& b, ImU32 col, float thickness = 1.0f);