Skip to content

Conversation

Daviey
Copy link

@Daviey Daviey commented Oct 6, 2025

This adds a squash effect when the cursor gets near screen edges. It flattens against them like it's being pressed. Had a lot of fun implementing Hooke's law (https://en.wikipedia.org/wiki/Hooke%27s_law) for the spring physics to get a nice bounce-back feel when you pull away from edges.

In corners it squashes diagonally, transitioning smoothly from horizontal to vertical as you move around. Still not quite happy with how that corner transition feels but it's pretty good.

Config options are distance (how far from edge it triggers), strength (how much squash), corner_radius (when corners kick in), spring_stiffness (bounce-back speed), and spring_damping (prevents wobbling).

I updated the readme but didn't add a video, thought it might make more sense for you to add one so they look consistent with the other demos.

Also made it enabled by default, which might need changing?

Closes #63

Squashes the cursor when near screen edges, with spring physics for
bounce-back and smooth corner handling.

Closes VirtCode#63
@VirtCode
Copy link
Owner

VirtCode commented Oct 6, 2025

Wow this is amazing. I have quickly built it and tried it out and it already looks really funny.

I am pretty busy at the moment with uni and stuff so I'll probably only be able to properly go through it this weekend. So you'll have to bear with me. But I'm looking forward to play with this more!

Maybe a quick issue I have already noticed on my multimonitor setup, we probably don't want to squash the cursor if we are at an edge which has a monitor on the other side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feature request] Squash when hitting a screen edge

2 participants