cuthbertLab / music21j

Javascript port of music21 -- Toolkit for Computational Musicology
Other
144 stars 41 forks source link

Factor scrollLeft/scrollTop into Stream.getUnscaledXYforDOM() #153

Closed vanderstel closed 2 years ago

vanderstel commented 2 years ago

Ensure that the scrollLeft and scrollTop of the container svg is factored into the calculation of the X and Y coordinates in Stream.getUnscaledXYforDOM().

mscuthbert commented 2 years ago

I'm not sure about this -- pageX should already take into account Scroll for MouseEvents and then in the TouchEvent code we're explicitly calculating scrollLeft into the behavior. What is the problem that this is trying to fix?

vanderstel commented 2 years ago

I don't believe scrollLeft for the container is factored into pageX because the container is the event target for the event passed to getUnscaledXYforDOM. This is only a problem when the container has overflow-x set, though, which we could discourage in favor of setting overflow-x to a parent of the container. Closing.