All-leading tabs can crash layout

未关闭 适合新手
#48 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
82/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
lua
领域
game-dev

调研方向

从 TabBarScrollToTab() 的实现以及 order = sections[1].TabCount + 1 之后紧跟 tab_bar.Tabs.Data[order] 索引访问的位置开始。在该访问之前,添加针对 tab_bar.Tabs.Size 的边界检查,然后测试一个每个标签页都使用 ImGuiTabItemFlags.Leading 的标签栏,以确认布局不再崩溃。完成意味着在不改变正常标签页滚动的情况下阻止越界访问。

由索引模型根据 Issue 内容生成。

描述

bug question widgets

Upstream currently has this potential problem in TabBarScrollToTab():

When every tab has ImGuiTabItemFlags.Leading, TabBarScrollToTab() selects index TabCount + 1, beyond the active tabs, then accesses tab.Flags.

Possible fix:

order = sections[1].TabCount + 1
if order > tab_bar.Tabs.Size then return end -- NOTE: this check is added
tab = tab_bar.Tabs.Data[order]

I open this issue in case I forget about it.

NOTE: discovered by AI!

主要语言
Lua
星标
18
派生
3
平均合并
23 小时 23 分钟
30 天内合并 PR
1

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

相似的 Issue

更多 Lua Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。