mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-07-01 04:07:53 +08:00
GraphView: Highlight the edges of the selected node
This commit is contained in:
@ -62,12 +62,17 @@ class MyPainter extends CustomPainter {
|
|||||||
void paint(Canvas canvas, Size size) {
|
void paint(Canvas canvas, Size size) {
|
||||||
// Draw all the edges
|
// Draw all the edges
|
||||||
for (var edge in graph.edges) {
|
for (var edge in graph.edges) {
|
||||||
|
var strokeWitdth = 2.5;
|
||||||
|
if (edge.a.pressed || edge.b.pressed) {
|
||||||
|
strokeWitdth *= 2;
|
||||||
|
}
|
||||||
|
|
||||||
canvas.drawLine(
|
canvas.drawLine(
|
||||||
Offset(edge.a.x, edge.a.y),
|
Offset(edge.a.x, edge.a.y),
|
||||||
Offset(edge.b.x, edge.b.y),
|
Offset(edge.b.x, edge.b.y),
|
||||||
Paint()
|
Paint()
|
||||||
..color = Colors.grey
|
..color = Colors.grey
|
||||||
..strokeWidth = 2.5,
|
..strokeWidth = strokeWitdth,
|
||||||
/*onPanUpdate: (detail) {
|
/*onPanUpdate: (detail) {
|
||||||
print('Edge ${edge.a.label} -> ${edge.b.label} Swiped');
|
print('Edge ${edge.a.label} -> ${edge.b.label} Swiped');
|
||||||
},*/
|
},*/
|
||||||
|
Reference in New Issue
Block a user