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

Docs clarification and solve #2094. Unwrap TiledImage closure. #2134

Merged
merged 5 commits into from
Mar 31, 2022
Merged

Conversation

Aiosa
Copy link
Contributor

@Aiosa Aiosa commented Mar 23, 2022

Docs clarification and fix bug & implement propositions ~ issues #2133, #2094 . Move closure implementation of TiledImage to private members. Fix some tests.

@Aiosa
Copy link
Contributor Author

Aiosa commented Mar 23, 2022

I realized that the POST data feature does not necessarily require the format described in the docs, so I updated it to be more accurate.

@Aiosa
Copy link
Contributor Author

Aiosa commented Mar 23, 2022

Ah, the fix broke one test that needs fix too, stupid me should've checked earlier.

@Aiosa Aiosa closed this Mar 23, 2022
… tests that expect error message to appear in 'log' instead of 'error'.
@Aiosa Aiosa reopened this Mar 23, 2022
@Aiosa Aiosa changed the title Docs clarification and solve #2094. Docs clarification and solve #2094. Unwrap TileSource closure. Mar 23, 2022
@Aiosa Aiosa changed the title Docs clarification and solve #2094. Unwrap TileSource closure. Docs clarification and solve #2094. Unwrap TiledImage closure. Mar 23, 2022
@Aiosa
Copy link
Contributor Author

Aiosa commented Mar 23, 2022

Ok, it is ready. I tried to even fix unrelated failing tests - mostly it was bad test design.
There are still two failing test suites, one looks like the test is wrong, not the implementation. Other I am not sure. In case I should do something about it let me know.

One test expects OSD to fire drag-end when the mouse did not move but a click occurred.
Other expects black pixel on tiled multiimage where a black letter was added. Did not really check whether it reads correct position, hard to say...

@Aiosa
Copy link
Contributor Author

Aiosa commented Mar 23, 2022

This reminds me: I decided to make coverage... methods 'static', since they do not touch TiledImage instance... but if you want them as class methods instead I can change it.

Copy link
Member

@iangilman iangilman left a comment

Choose a reason for hiding this comment

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

This is fantastic! Thank you for the thorough and detailed job here, and thank you for fixing the related things you found along the way!

Thank you for fixing the unrelated tests as well. Are you up for fixing the last test as discussed in Discord? You're right that it's testing the wrong thing: We don't want drag-end to fire if there has been no movement.

As for making the coverage functions class functions instead of instance, seems reasonable... I don't feel strongly one way or the other.

One minor quibble: Fixing #2133 is such a huge thing, it would have been nice to have #2094 in a different pull request so they don't get mixed up together. We can run with it as is, but something to keep in mind for next time.

Anyway, this is a fantastic step forward! Seems to be functioning smoothly. I think it's all good (except for one minor formatting comment); let me know about that test.

src/tiledimage.js Outdated Show resolved Hide resolved
…s on drag-end event no longer firing when mouse does not move (PR #2064)
@Aiosa Aiosa requested a review from iangilman March 25, 2022 11:35
@Aiosa
Copy link
Contributor Author

Aiosa commented Mar 29, 2022

I was also thinking about replacing $.TiledImage... with this.constructor... ..?

@iangilman
Copy link
Member

I was also thinking about replacing $.TiledImage... with this.constructor... ..?

I think naming the class like we're doing is more clear from a readability standpoint. That said, if you think it's ugly, maybe that's an argument for making them instance methods instead of class methods. I don't know that we have any need for them to be class methods.

Copy link
Member

@iangilman iangilman left a comment

Choose a reason for hiding this comment

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

Thank you for the fixes. Everything looks great! I think this is ready to merge if you're happy with it, but I'm also happy with you making those class methods become instance methods if you like. Just let me know :)

@Aiosa
Copy link
Contributor Author

Aiosa commented Mar 29, 2022

Ok, I will change them to instance methods :)

@Aiosa
Copy link
Contributor Author

Aiosa commented Mar 30, 2022

Ready.

Copy link
Member

@iangilman iangilman left a comment

Choose a reason for hiding this comment

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

Looks great! Thank you again for doing this :)

@iangilman iangilman merged commit 8e63699 into openseadragon:master Mar 31, 2022
iangilman added a commit that referenced this pull request Mar 31, 2022
@msalsbery
Copy link
Member

You're right that it's testing the wrong thing: We don't want drag-end to fire if there has been no movement.

I noticed this comment in my notifications, just getting back on it now...

drag-end always fires if there was a drag-start, regardless of movement. The reasoning is drag-start can be used to set up many things for a drag operation, and without a corresponding drag-end, detecting the proper place to tear down anything set up in drag-start is pretty difficult - way more difficult then checking if there was any movement, which isn't included in the drag-end event anyway.

Anyway, that's why the test(s) were written that way

@iangilman
Copy link
Member

@msalsbery Good to see you! You might be interested in #2064 where I made it so we don't fire drag-end if there haven't been any drag events. There's no drag-start that I'm aware of; are the drag events what you were referring to?

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.

3 participants