Skip to content

Make the widget runnable as a browser demo.#15

Open
trangtinkers wants to merge 1 commit into
worrydream:masterfrom
trangtinkers:browser-demo
Open

Make the widget runnable as a browser demo.#15
trangtinkers wants to merge 1 commit into
worrydream:masterfrom
trangtinkers:browser-demo

Conversation

@trangtinkers
Copy link
Copy Markdown

Dashboard was retired in macOS Catalina, so add a small window.widget shim (localStorage-backed preferences, window.open for openURL) so the widget can run from a plain HTTP server.

Replace the hardcoded (8, 31) chrome/titlebar offset in getCoordsFromEvent with canvas.getBoundingClientRect()-based math. Without this, clicks land 8px left of where the map-pin hit test expects, and the 24px hit radius means drags frequently miss. The new math also divides out any CSS transform: scale() on the body so drags work under arbitrary scaling.

Dashboard was retired in macOS Catalina, so add a small window.widget
shim (localStorage-backed preferences, window.open for openURL) so the
widget can run from a plain HTTP server.

Replace the hardcoded (8, 31) chrome/titlebar offset in
getCoordsFromEvent with canvas.getBoundingClientRect()-based math.
Without this, clicks land 8px left of where the map-pin hit test
expects, and the 24px hit radius means drags frequently miss. The new
math also divides out any CSS transform: scale() on the body so drags
work under arbitrary scaling.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant