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

Desktop: Fixes #3628: Add scroll offset for dragging notes (ui_update branch) #3651

Merged
merged 1 commit into from
Sep 13, 2020

Conversation

DarinDev1000
Copy link

@DarinDev1000 DarinDev1000 commented Aug 20, 2020

Fixes #3628

The note dragging was not taking into account the scroll distance.
This caused the notes to be dragged to a different location than the mouse.
This scroll offset should fix that issue.

This fix was moved to ui_update branch instead of dev branch.
Original pull request on dev branch

The note draging was not taking into account the scroll distance.
This caused the notes to be dragged to a different location than the mouse.
This scroll offset should fix that issue.
@@ -141,7 +141,7 @@ class NoteListComponent extends React.Component {
}

dragTargetNoteIndex_(event:any) {
return Math.abs(Math.round((event.clientY - this.itemListRef.current.offsetTop()) / this.itemHeight)) - 1;
return Math.abs(Math.round((event.clientY - this.itemListRef.current.offsetTop() + this.itemListRef.current.offsetScroll()) / this.itemHeight));
Copy link
Author

@DarinDev1000 DarinDev1000 Aug 20, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was the - 1 at the end of the dragging notes calculation on purpose?
It is not currently in the dev branch.
It does not line up with the mouse if it is there. It makes the drag location 1 note high.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I've added that as the index somehow was off by 1 at some point while I was testing. But maybe it was some other issue, or your change fixes it properly. I'll give it a try to be sure.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I'm not sure which way it needs to be.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How's this look?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will test this change once I get back to the UI update, which should be relatively soon.

@DarinDev1000
Copy link
Author

For some reason, I can't link the issue #3628 to this pull request.

@laurent22 laurent22 merged commit 374ee3b into laurent22:ui_update Sep 13, 2020
@laurent22
Copy link
Owner

The fix was good, thanks @DarinDev1000!

@DarinDev1000
Copy link
Author

Thanks

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.

2 participants