Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions include/ImNodeFlow.h
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,12 @@ namespace ImFlow
*/
const ImVec2& getSize() { return m_size; }

/**
* @brief <BR>Get node size
* @return Const reference to the node's size
*/
const ImVec2& getFullSize() { return m_fullSize; }

/**
* @brief <BR>Get node position
* @return Const reference to the node's position
Expand Down Expand Up @@ -886,6 +892,7 @@ namespace ImFlow
std::string m_title;
ImVec2 m_pos, m_posTarget;
ImVec2 m_size;
ImVec2 m_fullSize;
ImNodeFlow* m_inf = nullptr;
std::shared_ptr<NodeStyle> m_style;
bool m_selected = false, m_selectedNext = false;
Expand Down
4 changes: 2 additions & 2 deletions src/ImNodeFlow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ namespace ImFlow {
float titleW = ImGui::GetItemRectSize().x;

// Inputs
if (!m_ins.empty()) {
if (!m_ins.empty() || !m_dynamicIns.empty()) {
ImGui::BeginGroup();
for (auto &p: m_ins) {
p->setPos(ImGui::GetCursorPos());
Expand Down Expand Up @@ -140,7 +140,7 @@ namespace ImFlow {
m_style->radius);
draw_list->AddRectFilled(offset + m_pos - paddingTL, offset + m_pos + headerSize, m_style->header_bg,
m_style->radius, ImDrawFlags_RoundCornersTop);

m_fullSize = m_size + paddingTL + paddingBR;
ImU32 col = m_style->border_color;
float thickness = m_style->border_thickness;
ImVec2 ptl = paddingTL;
Expand Down