Skip to content

Commit

Permalink
fixed assert
Browse files Browse the repository at this point in the history
  • Loading branch information
nem0 committed Oct 18, 2023
1 parent da79ebf commit a95bde4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/editor/asset_browser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1185,7 +1185,7 @@ struct AssetBrowserImpl : AssetBrowser {
static TextFilter filter;
filter.gui("Filter", width, focus);

float h = ImGui::GetContentRegionAvail().y - ImGui::GetTextLineHeightWithSpacing() * 2;
float h = maximum(200.f, ImGui::GetContentRegionAvail().y - ImGui::GetTextLineHeightWithSpacing() * 2);

ImGui::BeginChild("Resources", ImVec2(0, h), false, ImGuiWindowFlags_HorizontalScrollbar);
AssetCompiler& compiler = m_app.getAssetCompiler();
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/editor/render_plugins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2919,9 +2919,9 @@ struct ModelPlugin final : AssetBrowser::IPlugin, AssetCompiler::IPlugin {
}
}

const float radius = length(aabb.max - aabb.min) * 0.50001f;
const float radius = maximum(1e-5f, length(aabb.max - aabb.min) * 0.50001f);
const Vec3 center = (aabb.max + aabb.min) * 0.5f;
const Vec3 eye = center + Vec3(1, 1, 1) * length(aabb.max - aabb.min) / SQRT2;
const Vec3 eye = center + Vec3(1, 1, 1) * maximum(1e-5f, length(aabb.max - aabb.min)) / SQRT2;
Matrix mtx;
mtx.lookAt(eye, center, normalize(Vec3(1, -1, 1)));
Viewport viewport;
Expand Down

0 comments on commit a95bde4

Please sign in to comment.