Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change logic to keep selection on hover/pen up #1286

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Doublonmousse
Copy link
Collaborator

Fixes #1222

This prevents the state from switching to up/hover state if the pen is lifted when a selection is active (aka the ModifyState is Selecting).

I'm not sure how useful the hover state is right now.

@flxzt
Copy link
Owner

flxzt commented Nov 21, 2024

I'm not sure how useful the hover state is right now.

It is used to change the appearance of the resize/rotate nodes when hovering over them.
I haven't tested it yet but wouldn't this change cause the nodes to appear getting "stuck" in the down state?

@Doublonmousse
Copy link
Collaborator Author

I'm not sure how useful the hover state is right now.

It is used to change the appearance of the resize/rotate nodes when hovering over them. I haven't tested it yet but wouldn't this change cause the nodes to appear getting "stuck" in the down state?

Oh right, now I get it. And yes, it will force the state to Down as long as text is selected but that's also what happens currently when text is selected with the mouse

Screen.Recording.2024-11-21.at.19.59.19.mov

And with the the enum definition, there's no way around it https://github.com/Doublonmousse/rnote/blob/891b8e4cb68369424d2cae6665bca5abff79b974/crates/rnote-engine/src/pens/typewriter/mod.rs#L28C17-L28C28

It's either we have the text selected (ModifyState::Selecting) or we are hovering (ModifyState::Hover). We cannot have text selected and see the hover effect on the nodes.

@flxzt
Copy link
Owner

flxzt commented Nov 28, 2024

You're right, it' s a code architecture flaw. Hover really shouldn't be a enum variant of ModifyState..

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.

Unable to select text using stylus
2 participants