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.
- package/index.js +5 -16
- 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
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
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
|
}
|