diff --git a/src/assets/cursors/windows11/arrow__31-22.svg b/src/assets/cursors/windows11/arrow__31-22.svg index f17b1589..d1790cd0 100644 --- a/src/assets/cursors/windows11/arrow__31-22.svg +++ b/src/assets/cursors/windows11/arrow__31-22.svg @@ -1,3 +1,8 @@ - - + + + + + diff --git a/src/assets/cursors/windows11/block__50-50.svg b/src/assets/cursors/windows11/block__50-50.svg index 7e49badc..3e555c5c 100644 --- a/src/assets/cursors/windows11/block__50-50.svg +++ b/src/assets/cursors/windows11/block__50-50.svg @@ -1,3 +1,10 @@ - - + + + + + diff --git a/src/assets/cursors/windows11/busy__50-50.svg b/src/assets/cursors/windows11/busy__50-50.svg index c47a7ae1..52e53122 100644 --- a/src/assets/cursors/windows11/busy__50-50.svg +++ b/src/assets/cursors/windows11/busy__50-50.svg @@ -1,7 +1,24 @@ - - - - - - + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/cursors/windows11/cross__50-50.svg b/src/assets/cursors/windows11/cross__50-50.svg index 5e0d5e52..8cdf25a1 100644 --- a/src/assets/cursors/windows11/cross__50-50.svg +++ b/src/assets/cursors/windows11/cross__50-50.svg @@ -1,3 +1,8 @@ - - + + + + + diff --git a/src/assets/cursors/windows11/help__31-22.svg b/src/assets/cursors/windows11/help__31-22.svg index d7a4ebb5..8d8534b0 100644 --- a/src/assets/cursors/windows11/help__31-22.svg +++ b/src/assets/cursors/windows11/help__31-22.svg @@ -1,5 +1,28 @@ - - - - + + + + + + diff --git a/src/assets/cursors/windows11/move__51-51.svg b/src/assets/cursors/windows11/move__51-51.svg index 459ebcb9..f0cebf6f 100644 --- a/src/assets/cursors/windows11/move__51-51.svg +++ b/src/assets/cursors/windows11/move__51-51.svg @@ -1,3 +1,12 @@ - - + + + + + diff --git a/src/assets/cursors/windows11/pen__19-19.svg b/src/assets/cursors/windows11/pen__19-19.svg index bc05a6a3..0f9e3263 100644 --- a/src/assets/cursors/windows11/pen__19-19.svg +++ b/src/assets/cursors/windows11/pen__19-19.svg @@ -1,4 +1,11 @@ - - - + + + + + + + diff --git a/src/assets/cursors/windows11/person__50-50.svg b/src/assets/cursors/windows11/person__50-50.svg index f4fded61..ad587560 100644 --- a/src/assets/cursors/windows11/person__50-50.svg +++ b/src/assets/cursors/windows11/person__50-50.svg @@ -1,8 +1,18 @@ - - - - - - - + + + + + + + + + diff --git a/src/assets/cursors/windows11/pin__75-97.svg b/src/assets/cursors/windows11/pin__75-97.svg index f7242aec..6fc7da17 100644 --- a/src/assets/cursors/windows11/pin__75-97.svg +++ b/src/assets/cursors/windows11/pin__75-97.svg @@ -1,8 +1,18 @@ - - - - - - - + + + + + + + + + diff --git a/src/assets/cursors/windows11/pointer__54-35.svg b/src/assets/cursors/windows11/pointer__54-35.svg index 42e241f7..46efea24 100644 --- a/src/assets/cursors/windows11/pointer__54-35.svg +++ b/src/assets/cursors/windows11/pointer__54-35.svg @@ -1,6 +1,17 @@ - - - - - + + + + + + + + + diff --git a/src/assets/cursors/windows11/resize-diagonal-backslash__50-50.svg b/src/assets/cursors/windows11/resize-diagonal-backslash__50-50.svg index 2119d5fa..a81625d6 100644 --- a/src/assets/cursors/windows11/resize-diagonal-backslash__50-50.svg +++ b/src/assets/cursors/windows11/resize-diagonal-backslash__50-50.svg @@ -1,3 +1,9 @@ - - + + + + + diff --git a/src/assets/cursors/windows11/resize-diagonal-slash__50-50.svg b/src/assets/cursors/windows11/resize-diagonal-slash__50-50.svg index ebd706fc..1a536b73 100644 --- a/src/assets/cursors/windows11/resize-diagonal-slash__50-50.svg +++ b/src/assets/cursors/windows11/resize-diagonal-slash__50-50.svg @@ -1,3 +1,9 @@ - - + + + + + diff --git a/src/assets/cursors/windows11/resize-horizontal__51-49.svg b/src/assets/cursors/windows11/resize-horizontal__51-49.svg index 25cde2ee..ae39d301 100644 --- a/src/assets/cursors/windows11/resize-horizontal__51-49.svg +++ b/src/assets/cursors/windows11/resize-horizontal__51-49.svg @@ -1,3 +1,9 @@ - - + + + + + diff --git a/src/assets/cursors/windows11/resize-vertical__48-50.svg b/src/assets/cursors/windows11/resize-vertical__48-50.svg index 73149d2e..5d8fdae8 100644 --- a/src/assets/cursors/windows11/resize-vertical__48-50.svg +++ b/src/assets/cursors/windows11/resize-vertical__48-50.svg @@ -1,3 +1,9 @@ - - + + + + + diff --git a/src/assets/cursors/windows11/text__50-50.svg b/src/assets/cursors/windows11/text__50-50.svg index bf38ba24..62c48e13 100644 --- a/src/assets/cursors/windows11/text__50-50.svg +++ b/src/assets/cursors/windows11/text__50-50.svg @@ -1,3 +1,8 @@ - - + + + + + diff --git a/src/assets/cursors/windows11/up__49-21.svg b/src/assets/cursors/windows11/up__49-21.svg index f87afc9d..f946b004 100644 --- a/src/assets/cursors/windows11/up__49-21.svg +++ b/src/assets/cursors/windows11/up__49-21.svg @@ -1,3 +1,8 @@ - - + + + + + diff --git a/src/assets/cursors/windows11/wait__50-50.svg b/src/assets/cursors/windows11/wait__50-50.svg index cb00c79e..e59499cd 100644 --- a/src/assets/cursors/windows11/wait__50-50.svg +++ b/src/assets/cursors/windows11/wait__50-50.svg @@ -1,39 +1,44 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/components/video-editor/SettingsPanel.tsx b/src/components/video-editor/SettingsPanel.tsx index beaf6066..8be41018 100644 --- a/src/components/video-editor/SettingsPanel.tsx +++ b/src/components/video-editor/SettingsPanel.tsx @@ -888,7 +888,8 @@ function CursorStylePreview({ style === "windows11" ) { const resolvedPreviewSize = - (previewSize ?? BUILTIN_CURSOR_PREVIEW_SIZE) * getCursorStyleSizeMultiplier(style); + (previewSize ?? BUILTIN_CURSOR_PREVIEW_SIZE) * + (style === "windows11" ? 1 : getCursorStyleSizeMultiplier(style)); return (
{ + it("uses the native 32px cursor hotspots", () => { + expect(cursorSetAssets.windows11.arrow.fallbackAnchor).toEqual({ x: 0, y: 0 }); + expect(cursorSetAssets.windows11.pointer.fallbackAnchor).toEqual({ x: 6 / 32, y: 0 }); + expect(cursorSetAssets.windows11["resize-ew"].fallbackAnchor).toEqual({ + x: 11 / 32, + y: 4 / 32, + }); + expect(cursorSetAssets.windows11["resize-ns"].fallbackAnchor).toEqual({ + x: 4 / 32, + y: 11 / 32, + }); + expect(cursorSetAssets.windows11["not-allowed"].fallbackAnchor).toEqual({ + x: 8 / 32, + y: 8 / 32, + }); + }); + + it("normalizes the Windows cursor set from the measured arrow pixel height", () => { + expect(getCursorStyleSizeMultiplier("windows11")).toBeCloseTo(32 / 19.0625, 8); + }); +}); diff --git a/src/components/video-editor/videoPlayback/uploadedCursorAssets.ts b/src/components/video-editor/videoPlayback/uploadedCursorAssets.ts index b726301a..b5bdee39 100644 --- a/src/components/video-editor/videoPlayback/uploadedCursorAssets.ts +++ b/src/components/video-editor/videoPlayback/uploadedCursorAssets.ts @@ -17,10 +17,10 @@ import tahoePointerUrl from "../../../assets/cursors/tahoe/pointinghand-1__40-10 import tahoeResizeEwUrl from "../../../assets/cursors/tahoe/resizeeastwest-1__50-50.svg"; import tahoeResizeNsUrl from "../../../assets/cursors/tahoe/resizenorthsouth-1__50-49.svg"; import windows11ArrowUrl from "../../../assets/cursors/windows11/arrow__31-22.svg"; -import windows11ClosedHandUrl from "../../../assets/cursors/windows11/grabbing__50-50.svg"; -import windows11CrosshairUrl from "../../../assets/cursors/windows11/cross__50-50.svg"; import windows11NotAllowedUrl from "../../../assets/cursors/windows11/block__50-50.svg"; +import windows11CrosshairUrl from "../../../assets/cursors/windows11/cross__50-50.svg"; import windows11OpenHandUrl from "../../../assets/cursors/windows11/grab__50-50.svg"; +import windows11ClosedHandUrl from "../../../assets/cursors/windows11/grabbing__50-50.svg"; import windows11PointerUrl from "../../../assets/cursors/windows11/pointer__54-35.svg"; import windows11ResizeEwUrl from "../../../assets/cursors/windows11/resize-horizontal__51-49.svg"; import windows11ResizeNsUrl from "../../../assets/cursors/windows11/resize-vertical__48-50.svg"; @@ -35,7 +35,8 @@ const MACOS_POINTER_CONTENT_HEIGHT = 386; const TAHOE_POINTER_ASSET_HEIGHT = 958; const TAHOE_POINTER_CONTENT_HEIGHT = 851; const WINDOWS11_CURSOR_VIEWBOX_HEIGHT = 32; -const WINDOWS11_ARROW_CONTENT_HEIGHT = 18; +// Alpha bounds measured after correcting the bottom-up Windows system SVG coordinates. +const WINDOWS11_ARROW_CONTENT_HEIGHT = 19.0625; // Measured from the raw pointer assets using the non-shadow pixel bounds. const MACOS_CURSOR_STYLE_SIZE_MULTIPLIER = @@ -68,6 +69,15 @@ function asset( }; } +function windowsSystemAsset(url: string, hotspotX: number, hotspotY: number) { + return asset( + url, + (hotspotX / WINDOWS11_CURSOR_VIEWBOX_HEIGHT) * 100, + (hotspotY / WINDOWS11_CURSOR_VIEWBOX_HEIGHT) * 100, + { preserveCanvas: true }, + ); +} + export const cursorSetAssets: Record< Exclude, Record @@ -95,15 +105,16 @@ export const cursorSetAssets: Record< "not-allowed": asset(tahoeNotAllowedUrl, 23, 0), }, windows11: { - arrow: asset(windows11ArrowUrl, 31, 22, { preserveCanvas: true }), - text: asset(windows11TextUrl, 50, 50, { preserveCanvas: true }), - pointer: asset(windows11PointerUrl, 54, 35, { preserveCanvas: true }), - crosshair: asset(windows11CrosshairUrl, 50, 50, { preserveCanvas: true }), - "open-hand": asset(windows11OpenHandUrl, 50, 50, { preserveCanvas: true }), - "closed-hand": asset(windows11ClosedHandUrl, 50, 50, { preserveCanvas: true }), - "resize-ew": asset(windows11ResizeEwUrl, 51, 49, { preserveCanvas: true }), - "resize-ns": asset(windows11ResizeNsUrl, 48, 50, { preserveCanvas: true }), - "not-allowed": asset(windows11NotAllowedUrl, 50, 50, { preserveCanvas: true }), + // Hotspots are from the 32px frames embedded in the matching Windows .cur files. + arrow: windowsSystemAsset(windows11ArrowUrl, 0, 0), + text: windowsSystemAsset(windows11TextUrl, 16, 16), + pointer: windowsSystemAsset(windows11PointerUrl, 6, 0), + crosshair: windowsSystemAsset(windows11CrosshairUrl, 16, 16), + "open-hand": windowsSystemAsset(windows11OpenHandUrl, 16, 16), + "closed-hand": windowsSystemAsset(windows11ClosedHandUrl, 16, 16), + "resize-ew": windowsSystemAsset(windows11ResizeEwUrl, 11, 4), + "resize-ns": windowsSystemAsset(windows11ResizeNsUrl, 4, 11), + "not-allowed": windowsSystemAsset(windows11NotAllowedUrl, 8, 8), }, };