node-mac-recorder 1.12.0 → 1.13.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 +5 -16
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -167,23 +167,12 @@ 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
- // 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
170
 
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
- }
171
+ // Y coordinate conversion: CGWindow (top-left) to AVFoundation (bottom-left)
172
+ // Overlay'deki dönüşümle aynı mantık: screenHeight - windowY - windowHeight
173
+ const displayHeight = parseInt(display.resolution.split("x")[1]);
174
+ const convertedY = displayHeight - targetWindow.y - targetWindow.height;
175
+ adjustedY = Math.max(0, convertedY - display.y);
187
176
  break;
188
177
  }
189
178
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-mac-recorder",
3
- "version": "1.12.0",
3
+ "version": "1.13.0",
4
4
  "description": "Native macOS screen recording package for Node.js applications",
5
5
  "main": "index.js",
6
6
  "keywords": [