@aspiresys/visor 1.3.0 → 1.3.2
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/dist/index.js +5 -1
- package/dist/matcher.js +7 -0
- package/inspector/assets/capture.png +0 -0
- package/inspector/src/renderer.js +1 -1
- package/package.json +1 -1
- package/readme.md +1 -1
- package/inspector/templates/div.png +0 -0
- package/inspector/templates/match.png +0 -0
- package/inspector/templates/template.png +0 -0
package/dist/index.js
CHANGED
|
@@ -611,7 +611,11 @@ CONF:${m.confidence.toFixed(3)}
|
|
|
611
611
|
*/
|
|
612
612
|
async findText(text, index = 0, region) {
|
|
613
613
|
this.checkConfig();
|
|
614
|
-
|
|
614
|
+
const match = await (0, text_1.findText)(text, index, region);
|
|
615
|
+
if (match != null && region) {
|
|
616
|
+
return match.offset(region.x, region.y);
|
|
617
|
+
}
|
|
618
|
+
return match;
|
|
615
619
|
}
|
|
616
620
|
/**
|
|
617
621
|
* Checks whether specific text exists
|
package/dist/matcher.js
CHANGED
|
@@ -117,6 +117,7 @@ function findAllInspectorMatches(screen, template, confidence = 0.8) {
|
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
|
+
matches.sort((a, b) => b.confidence - a.confidence);
|
|
120
121
|
const filtered = [];
|
|
121
122
|
for (const match of matches) {
|
|
122
123
|
const tooClose = filtered.some((existing) => {
|
|
@@ -128,6 +129,12 @@ function findAllInspectorMatches(screen, template, confidence = 0.8) {
|
|
|
128
129
|
filtered.push(match);
|
|
129
130
|
}
|
|
130
131
|
}
|
|
132
|
+
filtered.sort((a, b) => {
|
|
133
|
+
if (a.y !== b.y) {
|
|
134
|
+
return a.y - b.y;
|
|
135
|
+
}
|
|
136
|
+
return a.x - b.x;
|
|
137
|
+
});
|
|
131
138
|
result.delete();
|
|
132
139
|
return filtered;
|
|
133
140
|
}
|
|
Binary file
|
|
@@ -121,7 +121,7 @@ saveBtn.addEventListener("click",
|
|
|
121
121
|
selectedTemplatePath = filePath;
|
|
122
122
|
currentTemplate.textContent = fileName;
|
|
123
123
|
currentTemplate.title = filePath;
|
|
124
|
-
matchResult.
|
|
124
|
+
matchResult.innerHTML = "<b>No Match Tested</b>";
|
|
125
125
|
ctx.drawImage(
|
|
126
126
|
image,
|
|
127
127
|
0,
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|