@bettergi/utils 0.1.26 → 0.1.27

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/dist/ocr.js +5 -6
  2. package/package.json +1 -1
package/dist/ocr.js CHANGED
@@ -247,12 +247,11 @@ export const findWithinListView = async (condition, listView, retryOptions, samp
247
247
  if (targetRegion?.isExist()) {
248
248
  const { item1, item2 } = targetRegion.convertPositionToGameCaptureRegion(0, 0);
249
249
  const scale = genshin.width / 1920;
250
- if (scale <= 1) {
251
- Object.assign(targetRegion, { x: item1, y: item2 });
252
- }
253
- else {
254
- Object.assign(targetRegion, { x: item1 / scale, y: item2 / scale });
255
- }
250
+ const [x, y] = [
251
+ Math.floor(scale <= 1 ? item1 : item1 / scale),
252
+ Math.floor(scale <= 1 ? item2 : item2 / scale)
253
+ ];
254
+ Object.assign(targetRegion, { x, y });
256
255
  return targetRegion;
257
256
  }
258
257
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bettergi/utils",
3
- "version": "0.1.26",
3
+ "version": "0.1.27",
4
4
  "description": "开发 BetterGI 脚本常用工具集",
5
5
  "type": "module",
6
6
  "author": "Bread Grocery<https://github.com/breadgrocery>",