MCPcopy Create free account
hub / github.com/Norbyte/bg3se / PushWindowStyleChanges

Method PushWindowStyleChanges

BG3Extender/Extender/Client/IMGUI/IMGUI.cpp:318–344  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

316
317
318void StyledRenderable::PushWindowStyleChanges(DrawingContext& context, ImFont*& font)
319{
320 if (Font) {
321 auto info = gExtender->IMGUI().GetFont(Font);
322 if (info) font = info->Font;
323 }
324
325 if (font) ImGui::PushFont(font);
326
327 if (!IDContext.empty()) {
328 ImGui::PushID(IDContext.data(), IDContext.data() + IDContext.size());
329 } else if (Label.empty()) {
330 ImGui::PushID((int32_t)Handle | (int32_t)(Handle >> 32));
331 }
332
333 if (PositionOffset) {
334 auto pos = ImGui::GetCursorPos();
335 auto offset = context.Scale(*PositionOffset);
336 ImGui::SetCursorPos(ImVec2(pos.x + offset.x, pos.y + offset.y));
337 } else if (AbsolutePosition) {
338 ImGui::SetCursorPos(ToImVec(*AbsolutePosition));
339 }
340
341 if (SameLine) ImGui::SameLine();
342 if (SamePosition) ImGui::SamePosition();
343 if (TextWrapPos) ImGui::PushTextWrapPos(context.Scale(*TextWrapPos));
344}
345
346
347void StyledRenderable::PopWindowStyleChanges(ImFont* font)

Callers

nothing calls this directly

Calls 6

ToImVecFunction · 0.85
GetFontMethod · 0.80
ScaleMethod · 0.80
emptyMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected