Invert scroll direction by X and Y
This commit is contained in:
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "wow-best-places",
|
||||
"description": "This app is supposed to make you feel nostalgic",
|
||||
"version": "1.3.0",
|
||||
"version": "1.3.1",
|
||||
"author": {
|
||||
"name": "obergodmar",
|
||||
"email": "obergodmar@gmail.com",
|
||||
|
||||
+1
-1
@@ -148,7 +148,7 @@ export default function App() {
|
||||
<MainMenuComponent>
|
||||
<div className='author'>
|
||||
<a href="https://github.com/obergodmar">obergodmar</a>
|
||||
<span>v1.3.0</span>
|
||||
<span>v1.3.1</span>
|
||||
</div>
|
||||
<MenuItemComponent
|
||||
isActive={isSettingsShown}
|
||||
|
||||
@@ -96,7 +96,7 @@ export const PanelComponent = ({
|
||||
}
|
||||
}, [isShown, resetPanel])
|
||||
|
||||
const handleDragScroll = (e: MouseEvent) => {
|
||||
const handleMouseMove = (e: MouseEvent) => {
|
||||
if (!isDrag) {
|
||||
return
|
||||
}
|
||||
@@ -194,7 +194,7 @@ export const PanelComponent = ({
|
||||
onTouchMove={handleTouchMove}
|
||||
onTouchEnd={handleFree}
|
||||
onMouseUp={handleFree}
|
||||
onMouseMove={handleDragScroll}
|
||||
onMouseMove={handleMouseMove}
|
||||
onMouseLeave={handleFree}
|
||||
onWheel={handleScroll}
|
||||
onBlur={handleFree}
|
||||
|
||||
@@ -82,8 +82,8 @@ export const ViewComponent = ({src}: Props) => {
|
||||
const limiter = (value: Position, width: number, height: number) => {
|
||||
const {x: xValue, y: yValue} = value
|
||||
|
||||
let x = trackPosition.x - xValue + lastPosition.x
|
||||
let y = trackPosition.y - yValue + lastPosition.y
|
||||
let x = lastPosition.x - trackPosition.x + xValue
|
||||
let y = lastPosition.y - trackPosition.y + yValue
|
||||
|
||||
if (x > 0) {
|
||||
x = 0
|
||||
@@ -121,7 +121,7 @@ export const ViewComponent = ({src}: Props) => {
|
||||
setLastPosition(position)
|
||||
}
|
||||
|
||||
const handleDragScroll = (e: MouseEvent) => {
|
||||
const handleMouseMove = (e: MouseEvent) => {
|
||||
if (!isDrag) {
|
||||
return
|
||||
}
|
||||
@@ -142,7 +142,7 @@ export const ViewComponent = ({src}: Props) => {
|
||||
backgroundPosition: `${position.x}px ${position.y}px`
|
||||
}}
|
||||
onMouseDown={handleMouseDown}
|
||||
onMouseMove={handleDragScroll}
|
||||
onMouseMove={handleMouseMove}
|
||||
onMouseUp={handleFree}
|
||||
onTouchMove={handleTouchMove}
|
||||
onTouchStart={handleTouchstart}
|
||||
|
||||
Reference in New Issue
Block a user