Hacker News new | past | comments | ask | show | jobs | submit login

I don't see the need to treat water different from earlier placed markers.

Here's how I would hack this: whenever you place an icon, draw a slighty larger circular 'lake' on top of that hidden canvas. That added lake prevents you from placing another icon in the neighborhood of that icon.




There is a performance hit for this. Rendering the 40 markers in the provided demo takes roughly 7ms on my machine vs 25ms for the fake lake method.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: