Skip to content

Commit

Permalink
fix: pop wrap pos #1532
Browse files Browse the repository at this point in the history
  • Loading branch information
hoffstadt committed Jan 15, 2022
1 parent 284bad1 commit 1b16ae9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions DearPyGui/src/ui/AppItems/basic/mvText.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,10 @@ namespace Marvel {
if (_color.r >= 0.0f)
ImGui::PushStyleColor(ImGuiCol_Text, _color.toVec4());

if (_wrap >= 0)
if (_wrap == 0)
ImGui::PushTextWrapPos((float)_wrap);
else if (_wrap > 0)
ImGui::PushTextWrapPos(ImGui::GetCursorPosX() + (float)_wrap);

if (_bullet)
ImGui::Bullet();
Expand All @@ -95,10 +97,8 @@ namespace Marvel {
state.middleclicked = ImGui::IsItemClicked(2);
state.contextRegionAvail = { ImGui::GetContentRegionAvail().x, ImGui::GetContentRegionAvail().y };

if (_wrap == 0)
ImGui::PushTextWrapPos((float)_wrap);
else if (_wrap > 0)
ImGui::PushTextWrapPos(ImGui::GetCursorPosX() + (float)_wrap);
if (_wrap >= 0)
ImGui::PopTextWrapPos();

if (_color.r >= 0.0f)
ImGui::PopStyleColor();
Expand Down

0 comments on commit 1b16ae9

Please sign in to comment.