diff --git a/package.json b/package.json index cf5b66d..392d62b 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/app/index.tsx b/src/app/index.tsx index df29eda..758ddee 100644 --- a/src/app/index.tsx +++ b/src/app/index.tsx @@ -148,7 +148,7 @@ export default function App() {
obergodmar - v1.3.0 + v1.3.1
{ + 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} diff --git a/src/components/view-component/view-component.tsx b/src/components/view-component/view-component.tsx index 9bc48aa..187cc83 100644 --- a/src/components/view-component/view-component.tsx +++ b/src/components/view-component/view-component.tsx @@ -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}