Skip to content

Commit 168b307

Browse files
committed
vpr: Add support for mouse interaction with drawn source/sink nodes
1 parent 2fb9c69 commit 168b307

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

vpr/src/draw/draw.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2582,6 +2582,18 @@ static int draw_check_rr_node_hit(float click_x, float click_y) {
25822582
}
25832583
break;
25842584
}
2585+
case SOURCE:
2586+
case SINK: {
2587+
float xcen, ycen;
2588+
draw_get_rr_src_sink_coords(device_ctx.rr_nodes[inode], &xcen, &ycen);
2589+
2590+
// Now check if we clicked on this pin
2591+
if (click_x >= xcen - draw_coords->pin_size && click_x <= xcen + draw_coords->pin_size && click_y >= ycen - draw_coords->pin_size && click_y <= ycen + draw_coords->pin_size) {
2592+
hit_node = inode;
2593+
return hit_node;
2594+
}
2595+
break;
2596+
}
25852597
case CHANX:
25862598
case CHANY: {
25872599
bound_box = draw_get_rr_chan_bbox(inode);

0 commit comments

Comments
 (0)