Skip to content

Commit

Permalink
HelpersImGui: fixed erroneous casts
Browse files Browse the repository at this point in the history
  • Loading branch information
corporateshark committed Jan 25, 2025
1 parent 3b3f565 commit 7399de7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lvk/HelpersImGui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ void ImGuiRenderer::endFrame(lvk::ICommandBuffer& cmdBuffer) {

ImDrawData* dd = ImGui::GetDrawData();

int fb_width = (int)(dd->DisplaySize.x * dd->FramebufferScale.x);
int fb_height = (int)(dd->DisplaySize.y * dd->FramebufferScale.y);
const float fb_width = dd->DisplaySize.x * dd->FramebufferScale.x;
const float fb_height = dd->DisplaySize.y * dd->FramebufferScale.y;
if (fb_width <= 0 || fb_height <= 0 || dd->CmdListsCount == 0) {
return;
}
Expand All @@ -196,8 +196,8 @@ void ImGuiRenderer::endFrame(lvk::ICommandBuffer& cmdBuffer) {
cmdBuffer.cmdBindViewport({
.x = 0.0f,
.y = 0.0f,
.width = (dd->DisplaySize.x * dd->FramebufferScale.x),
.height = (dd->DisplaySize.y * dd->FramebufferScale.y),
.width = fb_width,
.height = fb_height,
});

const float L = dd->DisplayPos.x;
Expand Down Expand Up @@ -263,8 +263,8 @@ void ImGuiRenderer::endFrame(lvk::ICommandBuffer& cmdBuffer) {
// clang-format off
if (clipMin.x < 0.0f) clipMin.x = 0.0f;
if (clipMin.y < 0.0f) clipMin.y = 0.0f;
if (clipMax.x > fb_width ) clipMax.x = (float)fb_width;
if (clipMax.y > fb_height) clipMax.y = (float)fb_height;
if (clipMax.x > fb_width ) clipMax.x = fb_width;
if (clipMax.y > fb_height) clipMax.y = fb_height;
if (clipMax.x <= clipMin.x || clipMax.y <= clipMin.y)
continue;
// clang-format on
Expand Down

0 comments on commit 7399de7

Please sign in to comment.