Skip to content
GitLab
探索
项目
群组
代码片段
项目
群组
代码片段
/
帮助
帮助
支持
社区论坛
快捷键
?
提交反馈
登录
切换导航
菜单
打开侧边栏
ExternalRepo
implot
提交
e5c457b3
提交
e5c457b3
编辑于
4年前
作者:
epezent
浏览文件
操作
下载
电子邮件补丁
差异文件
tidy up selection/query code, add new methods
上级
ef6c55cd
master
backends
features/buffer
features/legend-scroll
features/neg-time
features/spec
v0.16
v0.15
v0.14
v0.13
v0.12
v0.11
v0.10
无相关合并请求
变更
1
Hide whitespace changes
Inline
Side-by-side
显示
1 个更改的文件
implot.cpp
+14
-7
implot.cpp
有
14 个添加
和
7 个删除
+14
-7
implot.cpp
+
14
-
7
浏览文件 @
e5c457b3
...
...
@@ -1281,6 +1281,17 @@ void UpdateAxisColors(int axis_flag, ImPlotAxis* axis) {
axis
->
ColorTxt
=
ImGui
::
GetColorU32
(
col_label
);
}
//-----------------------------------------------------------------------------
// RENDERING
//-----------------------------------------------------------------------------
static
inline
void
RenderSelectionRect
(
ImDrawList
&
DrawList
,
const
ImVec2
&
p_min
,
const
ImVec2
&
p_max
,
const
ImVec4
&
col
)
{
const
ImU32
col_bg
=
ImGui
::
GetColorU32
(
col
*
ImVec4
(
1
,
1
,
1
,
0.25
f
));
const
ImU32
col_bd
=
ImGui
::
GetColorU32
(
col
);
DrawList
.
AddRectFilled
(
p_min
,
p_max
,
col_bg
);
DrawList
.
AddRect
(
p_min
,
p_max
,
col_bd
);
}
//-----------------------------------------------------------------------------
// BeginPlot()
//-----------------------------------------------------------------------------
...
...
@@ -2342,13 +2353,9 @@ void EndPlot() {
DrawList
.
AddText
(
pos
+
gp
.
Style
.
AnnotationPadding
,
an
.
ColorFg
,
txt
);
}
// render selection
if
(
plot
.
Selected
)
{
const
ImVec4
col
=
GetStyleColorVec4
(
ImPlotCol_Selection
);
const
ImU32
col_bg
=
ImGui
::
GetColorU32
(
col
*
ImVec4
(
1
,
1
,
1
,
0.25
f
));
const
ImU32
col_bd
=
ImGui
::
GetColorU32
(
col
);
DrawList
.
AddRectFilled
(
plot
.
SelectRect
.
Min
+
plot
.
PlotRect
.
Min
,
plot
.
SelectRect
.
Max
+
plot
.
PlotRect
.
Min
,
col_bg
);
DrawList
.
AddRect
(
plot
.
SelectRect
.
Min
+
plot
.
PlotRect
.
Min
,
plot
.
SelectRect
.
Max
+
plot
.
PlotRect
.
Min
,
col_bd
);
}
if
(
plot
.
Selected
)
RenderSelectionRect
(
DrawList
,
plot
.
SelectRect
.
Min
+
plot
.
PlotRect
.
Min
,
plot
.
SelectRect
.
Max
+
plot
.
PlotRect
.
Min
,
GetStyleColorVec4
(
ImPlotCol_Selection
));
// render query
if
(
plot
.
Queried
)
{
const
ImVec4
col
=
GetStyleColorVec4
(
ImPlotCol_Query
);
...
...
This diff is collapsed.
Click to expand it.
编辑
预览
支持
Markdown
0%
请重试
或
添加新附件
.
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录
菜单
探索
项目
群组
代码片段