Skip to main content

draw_pointer

Function draw_pointer 

Source
fn draw_pointer(g: &mut Graphics, tip: Vec2, half: f32, color: Color)
Expand description

Append the arrow-cursor silhouette to g: a classic pointer filled with color, sized by NDC half-extent half, anchored at its hot-spot tip.

A single convex quad — tip, vertical left edge, tail point, right barb — because Graphics::draw_polygon fan-triangulates from the first vertex (a notched arrow would self-overlap) and because the dark-outline-behind trick (set_cursor draws a larger dark copy then a white one) only stays registered for a compact shape near the tip: scaling a far-from-tip tail about the tip would bloat its border out of proportion. The four points read unmistakably as a pointer while keeping both invariants.