Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calc zoom - LatLng helper issue (?) #9009

Closed
mmeeks opened this issue May 9, 2024 · 2 comments
Closed

Calc zoom - LatLng helper issue (?) #9009

mmeeks opened this issue May 9, 2024 · 2 comments
Assignees
Labels
bug Something isn't working unconfirmed

Comments

@mmeeks
Copy link
Contributor

mmeeks commented May 9, 2024

I try to click + or - in calc status bar to zoom in / out:

bundle.js:10734 Uncaught TypeError: Cannot read properties of undefined (reading 'x')
at Bounds.contains (bundle.js:10734:12)
at NewClass.setDesktopCalcViewOnZoom (bundle.js:11039:58)
at NewClass.setZoom (bundle.js:11069:43)
at NewClass.zoomOut (bundle.js:11085:22)
at actionsMap.zoomout (bundle.js:8943:22)
at Dispatcher.dispatch (bundle.js:9065:8)
at HTMLDivElement. (bundle.js:27135:80)
at HTMLDivElement.dispatch (bundle.js:978:35)
at elemData.handle (bundle.js:940:91)

Exception
:
TypeError: Cannot read properties of undefined (reading 'x') at Bounds.contains
this: Bounds
bounds:
max: undefined
min: undefined
obj: {x: 913, y: 42198}
point:

        var cursorInBounds = app.file.textCursor.visible ? cssBounds.contains({
            x: app.file.textCursor.rectangle.cX1,
            y: app.file.textCursor.rectangle.cY1
        }) : false;
  • Weirdly:

this.getPixelBounds() is cssBounds - which is valid:

Bounds {min: Point, max: Point}
max: Point {x: 1743, y: 357687}
min: Point {x: 607, y: 356617}
[[Prototype]]: Object

  • How does that object get corrupted ?

Bounds.prototype.contains = function(obj) {
var min, max;
var bounds;
var point;
if (Array.isArray(obj) || obj instanceof L.Point || obj instanceof cool.SimplePoint) {
point = toPoint(obj)
} else {
bounds = Bounds.toBounds(obj)
}
if (bounds) {
min = bounds.min;
max = bounds.max
} else {
min = max = point
}
return min.x >= this.min.x && max.x <= this.max.x && min.y >= this.min.y && max.y <= this.max.y
}

Array.isArray(obj) || obj instanceof L.Point || obj instanceof cool.SimplePoint

false

image

@mmeeks
Copy link
Contributor Author

mmeeks commented May 13, 2024

@gokaysatir is this closed ? =)

@gokaysatir
Copy link
Contributor

Yep, i forgot to close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working unconfirmed
Projects
Status: Done
Development

No branches or pull requests

2 participants