Node snap radius consolidation

This commit is contained in:
2026-04-26 17:11:10 +02:00
parent 533b6b1c00
commit ee34acae34
3 changed files with 3 additions and 3 deletions

View File

@@ -14,7 +14,7 @@ ROAD_SIZE :: 20
// Radius of the node
NODE_RADIUS :: 20
// Size of designated radius that determines when position is within node's 'sphere'
NODE_SNAP_RADIUS :: 3
NODE_SNAP_RADIUS :: 3 * NODE_RADIUS
// Default text size
TEXT_SIZE :: 50

View File

@@ -36,7 +36,7 @@ draw_roads :: proc(self: ^Simulator) {
draw_nodes :: proc(self: ^Simulator) {
for &node in self.nodes {
// draws the snapping radius if key is held down
if self.show_details do rl.DrawCircleV(node.pos, common.NODE_SNAP_RADIUS * common.NODE_RADIUS, common.NODE_SNAP_COLOUR)
if self.show_details do rl.DrawCircleV(node.pos, common.NODE_SNAP_RADIUS, common.NODE_SNAP_COLOUR)
// draws the node
rl.DrawCircleV(node.pos, common.NODE_RADIUS, common.NODE_DONE_COLOUR)
}

View File

@@ -32,7 +32,7 @@ node_within_snapping_radius :: proc(self: ^Node, pos: rl.Vector2) -> bool {
return rl.CheckCollisionPointCircle(
pos,
self.pos,
common.NODE_SNAP_RADIUS * common.NODE_RADIUS,
common.NODE_SNAP_RADIUS,
)
}