mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2025-01-01 10:04:12 +08:00
Update ocrtext.py
This commit is contained in:
parent
7ce84bd60e
commit
4b1a516abd
@ -78,7 +78,7 @@ class ocrtext(basetext):
|
|||||||
h4 = windows.WindowFromPoint(windows.POINT(p2[0], p1[1]))
|
h4 = windows.WindowFromPoint(windows.POINT(p2[0], p1[1]))
|
||||||
|
|
||||||
self.range_ui[-1].setrect(rect)
|
self.range_ui[-1].setrect(rect)
|
||||||
if globalconfig["multiregion"]:
|
if len(self.range_ui) > 1:
|
||||||
return
|
return
|
||||||
usehwnds = []
|
usehwnds = []
|
||||||
for _ in (h1, h2, h3, h4):
|
for _ in (h1, h2, h3, h4):
|
||||||
@ -89,14 +89,9 @@ class ocrtext(basetext):
|
|||||||
if not usehwnds:
|
if not usehwnds:
|
||||||
return
|
return
|
||||||
hwnd, count = Counter(usehwnds).most_common()[0]
|
hwnd, count = Counter(usehwnds).most_common()[0]
|
||||||
if self.hwnd:
|
if count == len(usehwnds):
|
||||||
if count == len(usehwnds):
|
self.hwnd = hwnd
|
||||||
self.hwnd = hwnd
|
self.pids = [windows.GetWindowThreadProcessId(hwnd)]
|
||||||
self.pids = [windows.GetWindowThreadProcessId(hwnd)]
|
|
||||||
else:
|
|
||||||
if count >= len(usehwnds) - 1:
|
|
||||||
self.hwnd = hwnd
|
|
||||||
self.pids = [windows.GetWindowThreadProcessId(hwnd)]
|
|
||||||
|
|
||||||
def setstyle(self):
|
def setstyle(self):
|
||||||
[_.setstyle() for _ in self.range_ui]
|
[_.setstyle() for _ in self.range_ui]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user