@lvce-editor/renderer-process 23.2.0 → 23.3.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.
@@ -3738,7 +3738,18 @@ const getEventClass = eventType => {
3738
3738
  };
3739
3739
 
3740
3740
  const mouseEvent = (element, eventType, options) => {
3741
- const event = new MouseEvent(eventType, options);
3741
+ // Get the element's bounding rect and calculate center position
3742
+ const rect = element.getBoundingClientRect();
3743
+ const centerX = rect.left + rect.width / 2;
3744
+ const centerY = rect.top + rect.height / 2;
3745
+
3746
+ // Ensure clientX and clientY are set if not provided
3747
+ const eventOptions = {
3748
+ ...options,
3749
+ clientX: options?.clientX ?? centerX,
3750
+ clientY: options?.clientY ?? centerY
3751
+ };
3752
+ const event = new MouseEvent(eventType, eventOptions);
3742
3753
  element.dispatchEvent(event);
3743
3754
  };
3744
3755
  const mouseDown = (element, options) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/renderer-process",
3
- "version": "23.2.0",
3
+ "version": "23.3.0",
4
4
  "keywords": [
5
5
  "lvce-editor",
6
6
  "renderer-process"