node-mac-recorder 2.22.18 → 2.22.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -37,6 +37,21 @@ function shouldCaptureCursorSample(lastCapturedData, currentData) {
37
37
  return false;
38
38
  }
39
39
 
40
+ function packDisplayInfoForExport(di) {
41
+ if (!di) return {};
42
+ return {
43
+ displayId: di.displayId,
44
+ displayX: Number.isFinite(Number(di.displayX))
45
+ ? Number(di.displayX)
46
+ : Number(di.x) || 0,
47
+ displayY: Number.isFinite(Number(di.displayY))
48
+ ? Number(di.displayY)
49
+ : Number(di.y) || 0,
50
+ width: di.displayWidth ?? di.width,
51
+ height: di.displayHeight ?? di.height,
52
+ };
53
+ }
54
+
40
55
  function transformGlobalToVideo(globalX, globalY, d) {
41
56
  if (!d || !d.videoRelative) {
42
57
  return {
@@ -241,13 +256,7 @@ function tryAppendTextInput(
241
256
  offsetY: d.videoOffsetY,
242
257
  }
243
258
  : {},
244
- displayInfo: d
245
- ? {
246
- displayId: d.displayId,
247
- width: d.displayWidth,
248
- height: d.displayHeight,
249
- }
250
- : {},
259
+ displayInfo: packDisplayInfoForExport(d),
251
260
  };
252
261
 
253
262
  if (
@@ -434,13 +443,7 @@ async function startCursorCapture(recorder, nativeBinding, intervalOrFilepath, o
434
443
  offsetY: di.videoOffsetY,
435
444
  }
436
445
  : {},
437
- displayInfo: di
438
- ? {
439
- displayId: di.displayId,
440
- width: di.displayWidth,
441
- height: di.displayHeight,
442
- }
443
- : {},
446
+ displayInfo: packDisplayInfoForExport(di),
444
447
  };
445
448
 
446
449
  if (di?.multiWindowBounds && di.multiWindowBounds.length > 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-mac-recorder",
3
- "version": "2.22.18",
3
+ "version": "2.22.19",
4
4
  "description": "Native macOS screen recording package for Node.js applications",
5
5
  "main": "index.js",
6
6
  "keywords": [