node-mac-recorder 1.11.0 → 1.12.0

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.
Files changed (2) hide show
  1. package/index.js +17 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -167,8 +167,23 @@ class MacRecorder extends EventEmitter {
167
167
  targetDisplayId = display.id; // Use actual display ID, not array index
168
168
  // Koordinatları display'e göre normalize et
169
169
  adjustedX = targetWindow.x - display.x;
170
- // Y koordinat düzeltmesi - window selector overlay ile sync için
171
- adjustedY = Math.max(0, targetWindow.y - display.y - 22);
170
+ // Dynamic Y coordinate offset calculation
171
+ // Get display bounds using both coordinate systems to calculate difference
172
+ const nativeBinding = require("./build/Release/mac_recorder.node") || require("./build/Debug/mac_recorder.node");
173
+ const displays = nativeBinding.getDisplays();
174
+ const nativeDisplay = displays.find(d => d.id === targetDisplayId);
175
+
176
+ if (nativeDisplay && display) {
177
+ // Calculate Y height difference between coordinate systems
178
+ // display.y comes from NSScreen.frame (window selector)
179
+ // nativeDisplay.y comes from CGDisplayBounds (recording)
180
+ const yOffset = Math.abs(display.y - nativeDisplay.y);
181
+ console.log(`📏 Dynamic Y offset calculated: ${yOffset}px (NSScreen: ${display.y}, CGDisplay: ${nativeDisplay.y})`);
182
+ adjustedY = Math.max(0, targetWindow.y - display.y - yOffset);
183
+ } else {
184
+ // Fallback to fixed offset if dynamic calculation fails
185
+ adjustedY = Math.max(0, targetWindow.y - display.y - 25);
186
+ }
172
187
  break;
173
188
  }
174
189
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-mac-recorder",
3
- "version": "1.11.0",
3
+ "version": "1.12.0",
4
4
  "description": "Native macOS screen recording package for Node.js applications",
5
5
  "main": "index.js",
6
6
  "keywords": [