You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This option would allow the content to be centered in the client space instead of anchored to the left top. If the user resizes the browser window or has zoom enabled and zooms out it will snap move to the center.
add the option
this.options={/** Enable content to center in client when zooming out */centering: false,};
add internal fields variables for offset values
/* {Number} Offset to center left position */__leftOffset: 0,/* {Number} Offset to center top position */__topOffset: 0,
add logic to calculator left and top offset based on size. I put this in _computerScrollMax function
add code to subtract the offset from the left and top when publishing. There are two callbacks in the __publish function
// Push values outif(self.__callback){self.__callback(self.__scrollLeft-self.__leftOffset,self.__scrollTop-self.__topOffset,self.__zoomLevel);// greg minus out here}
If This worked perfectly right I'd love to make a pull request but there is an issue with pinch to zoom. I guess since the offset is always being applied to left and top when performing a pinch it slides the content under you. I tired to fix this by then subtracting the offsets from where the touch code is done but it's still not perfect. Any suggestions or a different approach would be much appreciated.
I can post my code somewhere if anyone is interested in solving this.
The text was updated successfully, but these errors were encountered:
This option would allow the content to be centered in the client space instead of anchored to the left top. If the user resizes the browser window or has zoom enabled and zooms out it will snap move to the center.
add the option
add internal fields variables for offset values
add logic to calculator left and top offset based on size. I put this in _computerScrollMax function
add code to subtract the offset from the left and top when publishing. There are two callbacks in the __publish function
If This worked perfectly right I'd love to make a pull request but there is an issue with pinch to zoom. I guess since the offset is always being applied to left and top when performing a pinch it slides the content under you. I tired to fix this by then subtracting the offsets from where the touch code is done but it's still not perfect. Any suggestions or a different approach would be much appreciated.
I can post my code somewhere if anyone is interested in solving this.
The text was updated successfully, but these errors were encountered: