Skip to content

Delete The Middle Circle #361

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Changes from 7 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
33 changes: 26 additions & 7 deletions ImGuizmo.cpp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@

namespace IMGUIZMO_NAMESPACE
{
static bool drawCircle = false;
static const float ZPI = 3.14159265358979323846f;
static const float RAD2DEG = (180.f / ZPI);
static const float DEG2RAD = (ZPI / 180.f);
Expand Down Expand Up @@ -1443,8 +1444,15 @@ namespace IMGUIZMO_NAMESPACE
}
}


// draw screen cirle
drawList->AddCircleFilled(gContext.mScreenSquareCenter, gContext.mStyle.CenterCircleSize, colors[0], 32);
if (ImGui::IsKeyPressed(ImGuiKey_O,false)) {
drawCircle = !drawCircle;
}
if (drawCircle) {
drawList->AddCircleFilled(gContext.mScreenSquareCenter, gContext.mStyle.CenterCircleSize, colors[0], 32);
}
// drawList->AddCircleFilled(gContext.mScreenSquareCenter, gContext.mStyle.CenterCircleSize, colors[0], 32);

if (gContext.mbUsing && (gContext.GetCurrentID() == gContext.mEditingID) && IsScaleType(type))
{
Expand Down Expand Up @@ -1529,7 +1537,14 @@ namespace IMGUIZMO_NAMESPACE
}

// draw screen cirle
drawList->AddCircle(gContext.mScreenSquareCenter, 20.f, colors[0], 32, gContext.mStyle.CenterCircleSize);

// draw screen cirle
if (ImGui::IsKeyPressed(ImGuiKey_O, false)) {
drawCircle = !drawCircle;
}
if (drawCircle) {
drawList->AddCircleFilled(gContext.mScreenSquareCenter, gContext.mStyle.CenterCircleSize, colors[0], 32);
}

if (gContext.mbUsing && (gContext.GetCurrentID() == gContext.mEditingID) && IsScaleType(type))
{
Expand Down Expand Up @@ -1622,9 +1637,13 @@ namespace IMGUIZMO_NAMESPACE
}
}
}

drawList->AddCircleFilled(gContext.mScreenSquareCenter, gContext.mStyle.CenterCircleSize, colors[0], 32);


if (ImGui::IsKeyPressed(ImGuiKey_O, false)) {
drawCircle = !drawCircle;
}
if (drawCircle) {
drawList->AddCircleFilled(gContext.mScreenSquareCenter, gContext.mStyle.CenterCircleSize, colors[0], 32);
}
if (gContext.mbUsing && (gContext.GetCurrentID() == gContext.mEditingID) && IsTranslateType(type))
{
ImU32 translationLineColor = GetColorU32(TRANSLATION_LINE);
Expand Down Expand Up @@ -1932,7 +1951,7 @@ namespace IMGUIZMO_NAMESPACE
// screen
if (io.MousePos.x >= gContext.mScreenSquareMin.x && io.MousePos.x <= gContext.mScreenSquareMax.x &&
io.MousePos.y >= gContext.mScreenSquareMin.y && io.MousePos.y <= gContext.mScreenSquareMax.y &&
Contains(op, SCALE))
Contains(op, SCALE)&&drawCircle)
{
type = MT_SCALE_XYZ;
}
Expand Down Expand Up @@ -2093,7 +2112,7 @@ namespace IMGUIZMO_NAMESPACE
// screen
if (io.MousePos.x >= gContext.mScreenSquareMin.x && io.MousePos.x <= gContext.mScreenSquareMax.x &&
io.MousePos.y >= gContext.mScreenSquareMin.y && io.MousePos.y <= gContext.mScreenSquareMax.y &&
Contains(op, TRANSLATE))
Contains(op, TRANSLATE)&&drawCircle)
{
type = MT_MOVE_SCREEN;
}
Expand Down