Skip to content

Commit 0deaf31

Browse files
committed
momentary rollback to d3cod3 ofxImGui fork due to retina screens problems
1 parent 38dcacd commit 0deaf31

File tree

4 files changed

+16
-13
lines changed

4 files changed

+16
-13
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ In order to build ofxVisualProgramming, you'll need this addons:
7979

8080
#### [ofxHapPlayer](https://github.com/d3cod3/ofxHapPlayer)
8181

82-
#### [ofxImGui](https://github.com/Daandelange/ofxImGui)
82+
#### [ofxImGui](https://github.com/d3cod3/ofxImGui)
8383

8484
#### [ofxInfiniteCanvas](https://github.com/d3cod3/ofxInfiniteCanvas)
8585

@@ -128,7 +128,7 @@ git clone https://github.com/d3cod3/ofxFFmpegRecorder
128128
git clone https://github.com/Akira-Hayasaka/ofxGLEditor
129129
git clone https://github.com/jeffcrouse/ofxJSON
130130
git clone https://github.com/d3cod3/ofxHapPlayer
131-
git clone https://github.com/Daandelange/ofxImGui
131+
git clone https://github.com/d3cod3/ofxImGui
132132
git clone https://github.com/d3cod3/ofxInfiniteCanvas
133133
git clone --branch=of-0.10.0 https://github.com/d3cod3/ofxLua
134134
git clone https://github.com/danomatika/ofxMidi

src/core/FileBrowser/ImGuiFileBrowser.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,8 @@ namespace imgui_addons
704704
input_combobox_sz.y = std::min((inputcb_filter_files.size() + 1) * frame_height + style.WindowPadding.y * 2.0f,
705705
8 * ImGui::GetFrameHeight() + style.WindowPadding.y * 2.0f);
706706

707-
if(show_inputbar_combobox && ( ImGui::GetFocusedFocusScope() == focus_scope_id || ImGui::GetCurrentContext()->ActiveIdIsAlive == input_id ))
707+
// ImGui::GetFocusedFocusScope()
708+
if(show_inputbar_combobox && ( ImGui::GetFocusScopeID() == focus_scope_id || ImGui::GetCurrentContext()->ActiveIdIsAlive == input_id ))
708709
{
709710
ImGuiWindowFlags popupFlags = ImGuiWindowFlags_NoTitleBar |
710711
ImGuiWindowFlags_NoResize |
@@ -723,7 +724,8 @@ namespace imgui_addons
723724
ImGui::BeginChild("##InputBarComboBox", input_combobox_sz, true, popupFlags);
724725

725726
ImVec2 listbox_size = input_combobox_sz - ImGui::GetStyle().WindowPadding * 2.0f;
726-
if(ImGui::BeginListBox("##InputBarComboBoxList", listbox_size))
727+
// ImGui::BeginListBox
728+
if(ImGui::ListBoxHeader("##InputBarComboBoxList", listbox_size))
727729
{
728730
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.0f, 1.0f, 1.0f,1.0f));
729731
ImGui::PushFocusScope(focus_scope_id);
@@ -747,7 +749,8 @@ namespace imgui_addons
747749
}
748750
ImGui::PopFocusScope();
749751
ImGui::PopStyleColor(1);
750-
ImGui::EndListBox();
752+
//ImGui::EndListBox()
753+
ImGui::ListBoxFooter();
751754
}
752755
ImGui::EndChild();
753756
ImGui::PopStyleColor(2);

src/core/imgui_node_canvas.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -556,10 +556,10 @@ bool ImGuiEx::NodeCanvas::BeginNode( int nId, const char* _id, std::string name,
556556
// The combination of a cliprect and columns allows us to set a clipping space for node widgets while reserving drawable space for pins, without having to add an extra window / childframe.
557557
ImGui::PushClipRect( curNodeData.leftPins.region.Min, curNodeData.rightPins.region.Max, true); // Inner space + Node Spaces
558558
ImGui::BeginColumns("innerNode", 3,
559-
ImGuiOldColumnFlags_NoBorder
560-
| ImGuiOldColumnFlags_NoResize
559+
ImGuiColumnsFlags_NoBorder
560+
| ImGuiColumnsFlags_NoResize
561561
//| ImGuiOldColumnFlags_NoPreserveWidths
562-
| ImGuiOldColumnFlags_NoForceWithinWindow // important so there's no weird auto adjustments.
562+
| ImGuiColumnsFlags_NoForceWithinWindow // important so there's no weird auto adjustments.
563563
);
564564
// Column layout
565565
// Note: A column of 0 width will probably cause crashes
@@ -768,7 +768,7 @@ ImGuiEx::NodeConnectData ImGuiEx::NodeCanvas::AddNodePin( const int nodeID, cons
768768
auto connectingColor = ImGui::ColorConvertU32ToFloat4(_color);
769769
connectingColor.w = 0.4f;
770770
const LinkBezierData link_data = get_link_renderable(pinLayout.curDrawPos + ImVec2( IMGUI_EX_NODE_PIN_WIDTH*scaleFactor * -.5f, pinLayout.pinSpace.y * .5f),ImGui::GetMousePos(),IMGUI_EX_NODE_LINK_LINE_SEGMENTS_PER_LENGTH);
771-
canvasDrawList->AddBezierCubic(link_data.bezier.p0,link_data.bezier.p1,link_data.bezier.p2,link_data.bezier.p3,ImGui::ColorConvertFloat4ToU32(connectingColor),IMGUI_EX_NODE_LINK_THICKNESS,link_data.num_segments);
771+
canvasDrawList->AddBezierCurve(link_data.bezier.p0,link_data.bezier.p1,link_data.bezier.p2,link_data.bezier.p3,ImGui::ColorConvertFloat4ToU32(connectingColor),IMGUI_EX_NODE_LINK_THICKNESS,link_data.num_segments);
772772

773773
// add link info
774774
std::string _temp = _type+" "+_gui_label;
@@ -792,7 +792,7 @@ ImGuiEx::NodeConnectData ImGuiEx::NodeCanvas::AddNodePin( const int nodeID, cons
792792
auto connectingColor = ImGui::ColorConvertU32ToFloat4(_color);
793793
connectingColor.w = 0.4f;
794794
const LinkBezierData link_data = get_link_renderable(canvasView.translation+(_linksData.at(0)._toPinPosition*canvasView.scale),ImGui::GetMousePos(),IMGUI_EX_NODE_LINK_LINE_SEGMENTS_PER_LENGTH);
795-
canvasDrawList->AddBezierCubic(link_data.bezier.p0,link_data.bezier.p1,link_data.bezier.p2,link_data.bezier.p3,ImGui::ColorConvertFloat4ToU32(connectingColor),IMGUI_EX_NODE_LINK_THICKNESS,link_data.num_segments);
795+
canvasDrawList->AddBezierCurve(link_data.bezier.p0,link_data.bezier.p1,link_data.bezier.p2,link_data.bezier.p3,ImGui::ColorConvertFloat4ToU32(connectingColor),IMGUI_EX_NODE_LINK_THICKNESS,link_data.num_segments);
796796

797797
// add link info
798798
std::string _temp = _type+" "+_linksData.at(0)._linkLabel;
@@ -922,7 +922,7 @@ ImGuiEx::NodeConnectData ImGuiEx::NodeCanvas::AddNodePin( const int nodeID, cons
922922
_tempColor = IM_COL32(255,0,0,255);
923923
}
924924

925-
canvasDrawList->AddBezierCubic(link_data.bezier.p0, link_data.bezier.p1, link_data.bezier.p2, link_data.bezier.p3, _tempColor, IMGUI_EX_NODE_LINK_THICKNESS, link_data.num_segments);
925+
canvasDrawList->AddBezierCurve(link_data.bezier.p0, link_data.bezier.p1, link_data.bezier.p2, link_data.bezier.p3, _tempColor, IMGUI_EX_NODE_LINK_THICKNESS, link_data.num_segments);
926926
}
927927

928928
// Draw pin

src/ofxVisualProgramming.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,13 +136,13 @@ void ofxVisualProgramming::setup(ofxImGui::Gui* _guiRef, string release){
136136
// Dummy call to IO which will crash if _guiRef is not initialised.
137137
ImGui::GetIO();
138138
// Ensure ImGui gets loaded correctly
139-
if(ImGui::GetCurrentContext()==nullptr || !ImGui::GetCurrentContext()->Initialized){
139+
/*if(ImGui::GetCurrentContext()==nullptr || !ImGui::GetCurrentContext()->Initialized){
140140
ofxVPGui->setup();
141141
}
142142
// Manually force shared mode
143143
else {
144144
ofxVPGui->setSharedMode(true);
145-
}
145+
}*/
146146

147147
//ofLogError("ofxVP") << "Setting up ImGui from reference instance." << (ImGui::GetCurrentContext()->Initialized?'1':'0');
148148
}

0 commit comments

Comments
 (0)