MCPcopy Create free account
hub / github.com/Raais/ImStudio / create

Method create

src/sources/ims_buffer.cpp:171–193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169}
170
171void ImStudio::BufferWindow::create(std::string type_, bool atcursor)
172{
173 idgen++;
174 if (!((open_child) &&
175 (getbaseobj(open_child_id)) &&
176 (getobj(open_child_id)->child.open)))
177 {
178 // no child window open
179 Object widget(idgen, type_);
180 if (atcursor)
181 {
182 widget.pos = ImVec2(ImGui::GetMousePos().x - pos.x, ImGui::GetMousePos().y - pos.y);
183 }
184 objects.push_back(widget);
185 }
186 else
187 {
188 // child window open
189 BaseObject childwidget(idgen, type_, open_child_id);
190 getobj(open_child_id)->child.objects.push_back(childwidget);
191 }
192 selected_obj_id = idgen; // select the new object
193}

Callers 1

ShowSidebarMethod · 0.80

Calls 2

ImVec2Function · 0.85
push_backMethod · 0.80

Tested by

no test coverage detected