Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
ImRect Struct Reference

#include <src/imgui/imgui_internal.h>

+ Collaboration diagram for ImRect:

Public Member Functions

 ImRect ()
 
 ImRect (const ImVec2 &min, const ImVec2 &max)
 
 ImRect (const ImVec4 &v)
 
 ImRect (float x1, float y1, float x2, float y2)
 
ImVec2 GetCenter () const
 
ImVec2 GetSize () const
 
float GetWidth () const
 
float GetHeight () const
 
float GetArea () const
 
ImVec2 GetTL () const
 
ImVec2 GetTR () const
 
ImVec2 GetBL () const
 
ImVec2 GetBR () const
 
bool Contains (const ImVec2 &p) const
 
bool Contains (const ImRect &r) const
 
bool Overlaps (const ImRect &r) const
 
void Add (const ImVec2 &p)
 
void Add (const ImRect &r)
 
void Expand (const float amount)
 
void Expand (const ImVec2 &amount)
 
void Translate (const ImVec2 &d)
 
void TranslateX (float dx)
 
void TranslateY (float dy)
 
void ClipWith (const ImRect &r)
 
void ClipWithFull (const ImRect &r)
 
void Floor ()
 
bool IsInverted () const
 
ImVec4 ToVec4 () const
 

Public Attributes

ImVec2 Min
 
ImVec2 Max
 

Detailed Description

Constructor & Destructor Documentation

◆ ImRect() [1/4]

ImRect::ImRect ( )
inline
475: Min(0.0f, 0.0f), Max(0.0f, 0.0f) {}
ImVec2 Max
Definition imgui_internal.h:473
ImVec2 Min
Definition imgui_internal.h:472

◆ ImRect() [2/4]

ImRect::ImRect ( const ImVec2 min,
const ImVec2 max 
)
inline
476: Min(min), Max(max) {}

◆ ImRect() [3/4]

ImRect::ImRect ( const ImVec4 v)
inline
477: Min(v.x, v.y), Max(v.z, v.w) {}
float x
Definition imgui.h:259
float y
Definition imgui.h:259
float z
Definition imgui.h:259
float w
Definition imgui.h:259

◆ ImRect() [4/4]

ImRect::ImRect ( float  x1,
float  y1,
float  x2,
float  y2 
)
inline
478: Min(x1, y1), Max(x2, y2) {}

Member Function Documentation

◆ Add() [1/2]

void ImRect::Add ( const ImRect r)
inline
493{ if (Min.x > r.Min.x) Min.x = r.Min.x; if (Min.y > r.Min.y) Min.y = r.Min.y; if (Max.x < r.Max.x) Max.x = r.Max.x; if (Max.y < r.Max.y) Max.y = r.Max.y; }
float y
Definition imgui.h:246
float x
Definition imgui.h:246

References Max, Min, ImVec2::x, and ImVec2::y.

◆ Add() [2/2]

void ImRect::Add ( const ImVec2 p)
inline
492{ if (Min.x > p.x) Min.x = p.x; if (Min.y > p.y) Min.y = p.y; if (Max.x < p.x) Max.x = p.x; if (Max.y < p.y) Max.y = p.y; }

References ImVec2::x, and ImVec2::y.

Referenced by ImGui::CalcListClipping(), ImGui::DebugNodeDrawCmdShowMeshAndBoundingBox(), ImGui::NewFrame(), and RenderViewportsThumbnails().

+ Here is the caller graph for this function:

◆ ClipWith()

void ImRect::ClipWith ( const ImRect r)
inline
499{ Min = ImMax(Min, r.Min); Max = ImMin(Max, r.Max); } // Simple version, may lead to an inverted rectangle, which is fine for Contains/Overlaps test but not for display.
static T ImMax(T lhs, T rhs)
Definition imgui_internal.h:410
static T ImMin(T lhs, T rhs)
Definition imgui_internal.h:409

References ImMax(), ImMin(), Max, and Min.

Referenced by ImGui::Begin(), ImGui::BeginMenuBar(), ImGui::BeginTableEx(), ImGui::InputTextEx(), ImGui::IsMouseHoveringRect(), ImGui::RenderNavHighlight(), ImGui::RenderWindowDecorations(), and ImGui::TableEndRow().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ClipWithFull()

void ImRect::ClipWithFull ( const ImRect r)
inline
500{ Min = ImClamp(Min, r.Min, r.Max); Max = ImClamp(Max, r.Min, r.Max); } // Full version, ensure both points are fully clipped.
static T ImClamp(T v, T mn, T mx)
Definition imgui_internal.h:411

References ImClamp(), Max, and Min.

Referenced by ImGui::Begin(), ImGui::BeginColumns(), ImGui::BeginTableEx(), ImGui::DebugRenderViewportThumbnail(), ImGui::NavScoreItem(), ImGui::NavUpdate(), and ImGui::TableUpdateLayout().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Contains() [1/2]

bool ImRect::Contains ( const ImRect r) const
inline
490{ return r.Min.x >= Min.x && r.Min.y >= Min.y && r.Max.x <= Max.x && r.Max.y <= Max.y; }

References Max, Min, ImVec2::x, and ImVec2::y.

◆ Contains() [2/2]

bool ImRect::Contains ( const ImVec2 p) const
inline
489{ return p.x >= Min.x && p.y >= Min.y && p.x < Max.x && p.y < Max.y; }

References ImVec2::x, and ImVec2::y.

Referenced by ImGui::AcceptDragDropPayload(), ImGui::Begin(), ImGui::FindBestWindowPosForPopupEx(), FindHoveredWindow(), ImGui::IsMouseHoveringRect(), ImGui::NavUpdate(), ImGui::PlotEx(), ImGui::RenderNavHighlight(), ImGui::ScrollToBringRectIntoView(), ImGui::TableMergeDrawChannels(), and ImGui::UpdateMouseMovingWindowEndFrame().

+ Here is the caller graph for this function:

◆ Expand() [1/2]

void ImRect::Expand ( const float  amount)
inline
494{ Min.x -= amount; Min.y -= amount; Max.x += amount; Max.y += amount; }

References ImVec2::x, and ImVec2::y.

Referenced by ImGui::AcceptDragDropPayload(), ImGui::Begin(), ImGui::CloseButton(), ImGui::ColorButton(), FindHoveredWindow(), ImGui::GetWindowAllowedExtentRect(), ImGui::NavUpdate(), ImGui::ProgressBar(), ImGui::RenderNavHighlight(), ImGui::ScrollbarEx(), and ImGui::SplitterBehavior().

+ Here is the caller graph for this function:

◆ Expand() [2/2]

void ImRect::Expand ( const ImVec2 amount)
inline
495{ Min.x -= amount.x; Min.y -= amount.y; Max.x += amount.x; Max.y += amount.y; }

References ImVec2::x, and ImVec2::y.

◆ Floor()

void ImRect::Floor ( )
inline
501{ Min.x = IM_FLOOR(Min.x); Min.y = IM_FLOOR(Min.y); Max.x = IM_FLOOR(Max.x); Max.y = IM_FLOOR(Max.y); }
#define IM_FLOOR(_VAL)
Definition imgui_internal.h:232

References IM_FLOOR, ImVec2::x, and ImVec2::y.

◆ GetArea()

float ImRect::GetArea ( ) const
inline
484{ return (Max.x - Min.x) * (Max.y - Min.y); }

References ImVec2::x, and ImVec2::y.

Referenced by ImGui::CloseButton().

+ Here is the caller graph for this function:

◆ GetBL()

ImVec2 ImRect::GetBL ( ) const
inline
487{ return ImVec2(Min.x, Max.y); } // Bottom-left
Definition imgui.h:245

References ImVec2::x, and ImVec2::y.

Referenced by ImGui::BeginCombo(), ImGui::BeginMenu(), ImGui::ColorEdit4(), ImGui::InputTextEx(), and ImGui::RenderWindowDecorations().

+ Here is the caller graph for this function:

◆ GetBR()

ImVec2 ImRect::GetBR ( ) const
inline
488{ return Max; } // Bottom-right

Referenced by ImGui::BeginMenu(), and ImGui::RenderWindowDecorations().

+ Here is the caller graph for this function:

◆ GetCenter()

ImVec2 ImRect::GetCenter ( ) const
inline
480{ return ImVec2((Min.x + Max.x) * 0.5f, (Min.y + Max.y) * 0.5f); }

References ImVec2::x, and ImVec2::y.

Referenced by ImGui::CloseButton(), ImGui::CollapseButton(), and ImGui::RadioButton().

+ Here is the caller graph for this function:

◆ GetHeight()

float ImRect::GetHeight ( ) const
inline
483{ return Max.y - Min.y; }

References ImVec2::y.

Referenced by ImGui::AcceptDragDropPayload(), ImGui::Begin(), ImGui::DebugNodeTable(), ImGui::EndTable(), ImGui::GetWindowAllowedExtentRect(), ImGui::NavCalcPreferredRefPos(), ImGui::NavEndFrame(), ImGui::NavUpdate(), ImGui::NavUpdatePageUpPageDown(), ImGui::ScrollbarEx(), ImGui::ShowMetricsWindow(), ImGui::TabBarLayout(), and ImGui::UpdateMouseWheel().

+ Here is the caller graph for this function:

◆ GetSize()

ImVec2 ImRect::GetSize ( ) const
inline

◆ GetTL()

ImVec2 ImRect::GetTL ( ) const
inline
485{ return Min; } // Top-left

Referenced by ImGui::BeginMenu().

+ Here is the caller graph for this function:

◆ GetTR()

ImVec2 ImRect::GetTR ( ) const
inline
486{ return ImVec2(Max.x, Min.y); } // Top-right

References ImVec2::x, and ImVec2::y.

Referenced by ImGui::BeginMenu().

+ Here is the caller graph for this function:

◆ GetWidth()

◆ IsInverted()

bool ImRect::IsInverted ( ) const
inline
502{ return Min.x > Max.x || Min.y > Max.y; }

References ImVec2::x, and ImVec2::y.

Referenced by ImGui::NavUpdate(), and ImGui::NavUpdatePageUpPageDown().

+ Here is the caller graph for this function:

◆ Overlaps()

bool ImRect::Overlaps ( const ImRect r) const
inline
491{ return r.Min.y < Max.y && r.Max.y > Min.y && r.Min.x < Max.x && r.Max.x > Min.x; }

References Max, Min, ImVec2::x, and ImVec2::y.

Referenced by ImGui::InputTextEx(), ImGui::IsClippedEx(), ImGui::IsItemVisible(), ImGui::IsRectVisible(), ImGui::IsRectVisible(), ImGui::NavProcessItem(), ImGui::NavScoreItem(), and ImGui::TableDrawBorders().

+ Here is the caller graph for this function:

◆ ToVec4()

ImVec4 ImRect::ToVec4 ( ) const
inline
503{ return ImVec4(Min.x, Min.y, Max.x, Max.y); }
Definition imgui.h:258

References ImVec2::x, and ImVec2::y.

Referenced by ImGui::NewFrame(), ImGui::SetWindowClipRectBeforeSetChannel(), ImGui::TableEndRow(), and ImGui::TableMergeDrawChannels().

+ Here is the caller graph for this function:

◆ Translate()

void ImRect::Translate ( const ImVec2 d)
inline
496{ Min.x += d.x; Min.y += d.y; Max.x += d.x; Max.y += d.y; }

References ImVec2::x, and ImVec2::y.

◆ TranslateX()

void ImRect::TranslateX ( float  dx)
inline
497{ Min.x += dx; Max.x += dx; }

References ImVec2::x.

Referenced by ImGui::NavEndFrame(), and ImGui::NavUpdateMoveResult().

+ Here is the caller graph for this function:

◆ TranslateY()

void ImRect::TranslateY ( float  dy)
inline
498{ Min.y += dy; Max.y += dy; }

References ImVec2::y.

Referenced by ImGui::NavEndFrame(), ImGui::NavUpdate(), and ImGui::NavUpdateMoveResult().

+ Here is the caller graph for this function:

Member Data Documentation

◆ Max

ImVec2 ImRect::Max

Referenced by ImGui::AcceptDragDropPayload(), Add(), ImGui::ArrowButtonEx(), ImGui::Begin(), ImGui::BeginColumns(), ImGui::BeginCombo(), ImGui::BeginDragDropTargetCustom(), ImGui::BeginListBox(), ImGui::BeginMenuBar(), ImGui::BeginTabBar(), ImGui::BeginTabBarEx(), ImGui::BeginTableEx(), ImGui::BeginViewportSideBar(), ImGui::ButtonEx(), ImGui::CalcListClipping(), CalcWindowSizeAfterConstraint(), ImGui::CalcWrapWidthForPos(), ImGui::Checkbox(), ClampWindowRect(), ClipWith(), ClipWithFull(), ImGui::CollapsingHeader(), ImGui::ColorButton(), ImGui::ColorPicker4(), Contains(), ImGui::DebugDrawItemRect(), ImGui::DebugNodeDrawCmdShowMeshAndBoundingBox(), ImGui::DebugNodeTabBar(), ImGui::DebugNodeTable(), ImGui::DebugNodeWindow(), ImGui::DebugRenderViewportThumbnail(), ImGui::DragScalar(), ImGui::EndChild(), ImGui::EndColumns(), ImGui::EndTabBar(), ImGui::EndTable(), ImGui::FindBestWindowPosForPopup(), ImGui::FindBestWindowPosForPopupEx(), ImGui::GetContentRegionMax(), ImGui::GetContentRegionMaxAbs(), ImGuiWindow::GetIDFromRectangle(), ImGui::GetItemRectMax(), GetResizeBorderRect(), ImGui::GetWindowContentRegionMax(), ImGui::GetWindowScrollbarRect(), ImGui::Image(), Slic3r::GUI::image_button_ex(), ImGui::ImageButtonEx(), ImGui::InputTextEx(), ImGui::IsMouseHoveringRect(), ImGui::ItemAdd(), ImGui::ItemHoverable(), ImGui::LabelTextV(), ImGui::NavCalcPreferredRefPos(), NavClampRectToVisibleAreaForMoveDir(), ImGui::NavEndFrame(), ImGui::NavProcessItem(), ImGui::NavScoreItem(), ImGui::NavUpdate(), ImGui::NavUpdateMoveResult(), ImGui::NavUpdatePageUpPageDown(), ImGui::NextColumn(), Overlaps(), ImGui::PlotEx(), ImGui::ProgressBar(), ImGui::PushColumnClipRect(), ImGui::RadioButton(), ImGui::RenderNavHighlight(), ImGui::RenderRectFilledRangeH(), ImGui::RenderRectFilledWithHole(), ImGui::RenderTextClippedEx(), ImGui::RenderWindowDecorations(), ImGui::RenderWindowOuterBorders(), ImGui::RenderWindowTitleBarContents(), ImGui::Scrollbar(), ImGui::ScrollbarEx(), ImGui::ScrollToBringRectIntoView(), Slic3r::GUI::ImGuiWrapper::search_list(), Slic3r::GUI::selectable(), ImGui::Selectable(), ImGui::SeparatorEx(), ImGui::SetFocusID(), ImGui::SetItemDefaultFocus(), ImGui::SetScrollHereX(), ImGui::ShowMetricsWindow(), ImGui::SliderScalar(), ImGui::TabBarLayout(), ImGui::TabBarScrollingButtons(), ImGui::TabItemBackground(), ImGui::TabItemEx(), ImGui::TabItemLabelAndCloseButton(), ImGui::TableBeginCell(), ImGui::TableDrawBorders(), ImGui::TableEndRow(), ImGui::TableGetMaxColumnWidth(), ImGui::TableHeader(), ImGui::TableMergeDrawChannels(), ImGui::TableSetBgColor(), ImGui::TableSetupDrawChannels(), ImGui::TableUpdateBorders(), ImGui::TableUpdateLayout(), ImGui::TextEx(), ImGui::TreeNodeBehavior(), ImGui::UpdateWindowManualResize(), and ImGui::VSliderScalar().

◆ Min

ImVec2 ImRect::Min

Referenced by ImGui::AcceptDragDropPayload(), Add(), ImGui::ArrowButtonEx(), ImGui::Begin(), ImGui::BeginCombo(), ImGui::BeginDragDropTargetCustom(), ImGui::BeginListBox(), ImGui::BeginMenuBar(), ImGui::BeginTabBarEx(), ImGui::BeginTableEx(), ImGui::BeginViewportSideBar(), ImGui::Bullet(), ImGui::BulletTextV(), ImGui::ButtonBehavior(), ImGui::ButtonEx(), ImGui::CalcListClipping(), CalcWindowSizeAfterConstraint(), ImGui::Checkbox(), ClampWindowRect(), ClipWith(), ClipWithFull(), ImGui::CollapseButton(), ImGui::CollapsingHeader(), ImGui::ColorButton(), ImGui::ColorPicker4(), Contains(), ImGui::DebugDrawItemRect(), ImGui::DebugNodeDrawCmdShowMeshAndBoundingBox(), ImGui::DebugNodeTabBar(), ImGui::DebugNodeTable(), ImGui::DebugNodeWindow(), ImGui::DebugRenderViewportThumbnail(), ImGui::DragScalar(), ImGui::EndChild(), ImGui::EndColumns(), ImGui::EndTable(), ImGui::FindBestWindowPosForPopup(), ImGui::FindBestWindowPosForPopupEx(), ImGuiWindow::GetIDFromRectangle(), ImGui::GetItemRectMin(), GetResizeBorderRect(), ImGui::GetWindowContentRegionMin(), ImGui::GetWindowScrollbarRect(), ImGui::Image(), Slic3r::GUI::image_button_ex(), ImGui::ImageButtonEx(), ImGui::InputTextEx(), ImGui::IsMouseHoveringRect(), ImGui::ItemAdd(), ImGui::ItemHoverable(), ImGui::LabelTextV(), ImGui::NavCalcPreferredRefPos(), NavClampRectToVisibleAreaForMoveDir(), ImGui::NavEndFrame(), ImGui::NavProcessItem(), ImGui::NavScoreItem(), ImGui::NavUpdate(), ImGui::NavUpdateMoveResult(), ImGui::NavUpdatePageUpPageDown(), Overlaps(), ImGui::PlotEx(), ImGui::ProgressBar(), ImGui::PushColumnClipRect(), ImGui::RadioButton(), ImGui::RenderNavHighlight(), ImGui::RenderRectFilledRangeH(), ImGui::RenderRectFilledWithHole(), ImGui::RenderTextClippedEx(), RenderViewportsThumbnails(), ImGui::RenderWindowDecorations(), ImGui::RenderWindowOuterBorders(), ImGui::RenderWindowTitleBarContents(), ImGui::Scrollbar(), ImGui::ScrollbarEx(), ImGui::ScrollToBringRectIntoView(), Slic3r::GUI::ImGuiWrapper::search_list(), Slic3r::GUI::selectable(), ImGui::Selectable(), ImGui::SeparatorEx(), ImGui::SetFocusID(), ImGui::SetItemDefaultFocus(), ImGui::SetScrollHereX(), ImGui::ShowMetricsWindow(), ImGui::SliderScalar(), ImGui::SplitterBehavior(), ImGui::TabBarLayout(), ImGui::TabBarQueueReorderFromMousePos(), ImGui::TabBarScrollingButtons(), ImGui::TabBarTabListPopupButton(), ImGui::TabItemBackground(), ImGui::TabItemEx(), ImGui::TabItemLabelAndCloseButton(), ImGui::TableBeginCell(), ImGui::TableBeginRow(), ImGui::TableDrawBorders(), ImGui::TableEndRow(), ImGui::TableHeader(), ImGui::TableMergeDrawChannels(), ImGui::TableSetupDrawChannels(), ImGui::TableUpdateBorders(), ImGui::TableUpdateLayout(), ImGui::TempInputText(), ImGui::TextEx(), ImGui::TreeNodeBehavior(), ImGui::UpdateWindowManualResize(), and ImGui::VSliderScalar().


The documentation for this struct was generated from the following file: