feat(touch): 单指点选+按住移动动作、端点把手拖拽改时长(触屏目标加大);空白单指不平移

- 选中动作后两端绘制白色把手,端点抓取半径触屏 28px(桌面保持 8px 精确),命中容差 14px

- 短条两端都够得着时抓离手指更近的一端,居中则整体移动

- 触屏空白单指不再平移画布(单指只做选择/编辑,双指捏合缩放+平移);Windows 操作模式不变

- 重建签名 APK
This commit is contained in:
admin
2026-10-07 22:44:28 +08:00
parent 2b04705ba8
commit e99f144793
6 changed files with 88 additions and 26 deletions
+18
View File
@@ -360,6 +360,11 @@ class BarPainter extends CustomPainter {
..color = tokens.crit,
);
}
// 选中时在两端绘制把手:提示可拖拽端点改时长(触屏目标更大、更好抓)。
if (sel) {
_handle(canvas, Offset(r.left, r.center.dy));
_handle(canvas, Offset(r.right, r.center.dy));
}
if (a.wrap && u.autoSplitWrap) {
final double wx = layout.xFor(a.endAngle - 360) - layout.plotLeft;
final Rect tail = Rect.fromLTWH(layout.plotLeft, r.top, math.max(wx, 2), r.height);
@@ -389,6 +394,19 @@ class BarPainter extends CustomPainter {
color: tokens.dim, size: 10, align: TextAlign.right);
}
/// 绘制端点把手:白边圆点,提示可拖拽端点改时长。
void _handle(Canvas canvas, Offset o) {
canvas.drawCircle(o, 6, Paint()..color = tokens.accent);
canvas.drawCircle(
o,
6,
Paint()
..style = PaintingStyle.stroke
..strokeWidth = 2
..color = Colors.white,
);
}
/// 绘制动作依赖连线(正交折线)。
///
/// 算法要点:
+15
View File
@@ -349,6 +349,21 @@ class CircularPainter extends CustomPainter {
..color = tokens.accent,
);
}
// 选中时在弧两端绘制把手:提示可拖拽端点改持续角(触屏更好抓)。
for (final Offset h in <Offset>[
polar(c, r, a.startAngle),
polar(c, r, math.min(a.endAngle, 360)),
]) {
canvas.drawCircle(h, 6, Paint()..color = tokens.accent);
canvas.drawCircle(
h,
6,
Paint()
..style = PaintingStyle.stroke
..strokeWidth = 2
..color = Colors.white,
);
}
}
// 文字沿圆弧排列并按弧长截断,保证始终位于动作色带之内。