@lvce-editor/source-control-worker 3.6.2 → 3.6.3

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.
@@ -2727,12 +2727,13 @@ const handleButtonClick = async (state, clickedIndex) => {
2727
2727
 
2728
2728
  const getIndex = (state, eventX, eventY) => {
2729
2729
  const {
2730
+ deltaY,
2730
2731
  headerHeight,
2731
2732
  itemHeight,
2732
2733
  y
2733
2734
  } = state;
2734
2735
  const relativeY = eventY - y - headerHeight;
2735
- const index = Math.floor(relativeY / itemHeight);
2736
+ const index = Math.floor((relativeY + deltaY) / itemHeight);
2736
2737
  return index;
2737
2738
  };
2738
2739
 
@@ -2875,9 +2876,12 @@ const selectIndex = async (state, index) => {
2875
2876
  };
2876
2877
 
2877
2878
  const handleClickAt = async (state, eventX, eventY, name) => {
2879
+ const {
2880
+ minLineY
2881
+ } = state;
2878
2882
  const index = getIndex(state, eventX, eventY);
2879
2883
  if (name) {
2880
- return handleClickSourceControlButtons(state, index, name);
2884
+ return handleClickSourceControlButtons(state, index - minLineY, name);
2881
2885
  }
2882
2886
  return selectIndex(state, index);
2883
2887
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/source-control-worker",
3
- "version": "3.6.2",
3
+ "version": "3.6.3",
4
4
  "description": "Source Control Worker",
5
5
  "keywords": [
6
6
  "Lvce Editor"