Skip to content

Commit 7b03313

Browse files
committed
fix scaling
1 parent 401f6e5 commit 7b03313

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/Core/RadialMenu.cpp

+4-6
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,8 @@ bool CRadialMenu::Render()
285285

286286
float contentDistance = this->SegmentContentDistance * NexusLink->Scaling;
287287

288-
static float contentSize = this->SegmentContentSize.x * NexusLink->Scaling;
289-
static float contentSizeHalf = this->SegmentContentSize.x / 2.0f;
290-
static float contentSizeHover = this->SegmentContentSize.x * 1.1f;
288+
float contentSize = this->SegmentContentSize.x * NexusLink->Scaling;
289+
float contentSizeHover = contentSize * 1.1f;
291290

292291
if (this->SegmentTexture)
293292
{
@@ -325,9 +324,8 @@ bool CRadialMenu::Render()
325324
{
326325
ImGui::Animate(contentSizeHover, contentSize, 50, &item->DisplayItemSize, ImAnimate::ECurve::OutCubic);
327326
}
328-
329-
float szDiff = (item->DisplayItemSize - contentSize) / 2.0f;
330-
ImGui::SetCursorPos(ImVec2(x - contentSizeHalf - szDiff, y - contentSizeHalf - szDiff));
327+
float contentSizeHalf = item->DisplayItemSize / 2.0f;
328+
ImGui::SetCursorPos(ImVec2(x - contentSizeHalf, y - contentSizeHalf));
331329
ImGui::Image(item->Icon.Texture->Resource, ImVec2(item->DisplayItemSize, item->DisplayItemSize), ImVec2(0, 0), ImVec2(1, 1), ImVec4(1, 1, 1, this->RenderOpacity));
332330
}
333331
else

0 commit comments

Comments
 (0)