fix: 修复图例改名不同步、细化网格标尺并支持标签页重排与曲线实色跟随拖拽
- 图例跟随重命名:绘图区图例文本改用信号当前显示名(Title), 左侧列表改名后网格图例立即同步。 - 标签页重排与改名:新增拖拽排序(按住标签左右拖动并显示插入指示条, 重排后保持原激活页)与双击内联改名,新增 MoveTab 正确处理激活下标。 修复改名后未重新布局导致标签页整条消失的问题(SetTabs 会重置标签矩形)。 双击判定改为自行按双击时间识别,不再依赖系统 WM_LBUTTONDBLCLK。 - 信号拖拽:虚影改用原信号颜色与线宽(不再画成虚线),保持原有线段/散点样式; 横向与纵向均自由跟随鼠标位移;拖拽首帧位移为零,虚影始终贴合在鼠标下方。 - 网格与标尺细化:时间轴与幅值轴期望刻度数提高,并在相邻主刻度之间 补绘 5 等分细线,便于目视估读。 - 图例定位与交互:图例移到各网格左上角,与标尺数字冲突时优先显示图例 (标尺数值主动避让);图例条目支持单击选中信号(与左侧列表联动、 样式区随之切换目标)与双击重命名信号。 - 网格划分:合并网格后新勾选的信号不再被并入那个唯一的合并网格, 而是自动切换为自定义划分并独占一个新网格。 - 工具栏:「每信号一格」改名为「拆分信号网格」。 - 清理:移除已无引用的 UiDrawArrowIcon 与 m_styleContentRect。
This commit is contained in:
1 parent
261b8ac07d
commit
4e295a2a7d
12 files changed
+800
-109
No files matched your search
@@ -808,6 +808,20 @@ namespace jdi
|
||||
return;
|
||||
}
|
||||
style->visible = visible;
|
||||
|
||||
// 合并模式下新勾选的信号独占一个新网格:避免「先合并已有信号、再加入新信号」
|
||||
// 时新信号被悄悄塞进那个唯一的合并网格里,导致用户看不到新增的独立泳道。
|
||||
if (visible && m_laneMode == LaneMode::MERGED)
|
||||
{
|
||||
m_laneMode = LaneMode::CUSTOM;
|
||||
Lane lane;
|
||||
lane.autoRange = true;
|
||||
lane.signals.push_back(ref);
|
||||
m_lanes.push_back(std::move(lane));
|
||||
SyncLanes(dataSet);
|
||||
return;
|
||||
}
|
||||
|
||||
SyncLanes(dataSet);
|
||||
}
|
||||
|
||||
|
||||
@@ -305,35 +305,6 @@ namespace jdi
|
||||
UiDrawLine(g, cx + arm, cy - arm, cx - arm, cy + arm, argb, strokeWidth);
|
||||
}
|
||||
|
||||
void UiDrawArrowIcon(gd::Graphics& g, const gd::RectF& rect, std::uint32_t argb, float strokeWidth,
|
||||
IconDirection direction)
|
||||
{
|
||||
const float cx = rect.X + rect.Width * 0.5f;
|
||||
const float cy = rect.Y + rect.Height * 0.5f;
|
||||
const float arm = std::min(rect.Width, rect.Height) * 0.26f;
|
||||
|
||||
switch (direction)
|
||||
{
|
||||
case IconDirection::LEFT:
|
||||
UiDrawLine(g, cx + arm * 0.6f, cy - arm, cx - arm * 0.6f, cy, argb, strokeWidth);
|
||||
UiDrawLine(g, cx - arm * 0.6f, cy, cx + arm * 0.6f, cy + arm, argb, strokeWidth);
|
||||
break;
|
||||
case IconDirection::RIGHT:
|
||||
UiDrawLine(g, cx - arm * 0.6f, cy - arm, cx + arm * 0.6f, cy, argb, strokeWidth);
|
||||
UiDrawLine(g, cx + arm * 0.6f, cy, cx - arm * 0.6f, cy + arm, argb, strokeWidth);
|
||||
break;
|
||||
case IconDirection::UP:
|
||||
UiDrawLine(g, cx - arm, cy + arm * 0.6f, cx, cy - arm * 0.6f, argb, strokeWidth);
|
||||
UiDrawLine(g, cx, cy - arm * 0.6f, cx + arm, cy + arm * 0.6f, argb, strokeWidth);
|
||||
break;
|
||||
case IconDirection::DOWN:
|
||||
default:
|
||||
UiDrawLine(g, cx - arm, cy - arm * 0.6f, cx, cy + arm * 0.6f, argb, strokeWidth);
|
||||
UiDrawLine(g, cx, cy + arm * 0.6f, cx + arm, cy - arm * 0.6f, argb, strokeWidth);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void UiDrawTriangleIcon(gd::Graphics& g, const gd::RectF& rect, std::uint32_t argb, IconDirection direction)
|
||||
{
|
||||
const float cx = rect.X + rect.Width * 0.5f;
|
||||
|
||||
Reference in new issue
Block a user