Fix map display and zoom issues
- Reduced region label size. - Restored connections. - Inverted zoom direction.
This commit is contained in:
@@ -104,8 +104,8 @@ export const RegionMap: React.FC<{ regionName: string }> = ({ regionName }) => {
|
||||
const mouseX = e.clientX - rect.left;
|
||||
const mouseY = e.clientY - rect.top;
|
||||
|
||||
// Reverse scroll direction: positive deltaY zooms out, negative zooms in
|
||||
const scale = e.deltaY > 0 ? 1.1 : 0.9;
|
||||
// Invert scroll direction: negative deltaY (scroll up) zooms out, positive (scroll down) zooms in
|
||||
const scale = e.deltaY < 0 ? 1.1 : 0.9;
|
||||
const newWidth = viewBox.width * scale;
|
||||
const newHeight = viewBox.height * scale;
|
||||
|
||||
@@ -113,7 +113,7 @@ export const RegionMap: React.FC<{ regionName: string }> = ({ regionName }) => {
|
||||
const mouseYInSVG = viewBox.y + (mouseY / rect.height) * viewBox.height;
|
||||
|
||||
const newX = mouseXInSVG - (mouseX / rect.width) * newWidth;
|
||||
const newY = mouseYInSVG - (mouseY / rect.height) * newWidth;
|
||||
const newY = mouseYInSVG - (mouseY / rect.height) * newHeight;
|
||||
|
||||
setViewBox({
|
||||
x: newX,
|
||||
|
Reference in New Issue
Block a user