mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-28 08:04:13 +08:00
repair
This commit is contained in:
parent
f9a0bc6b6c
commit
82bf1feaa6
@ -506,11 +506,11 @@ class Textbrowser(QLabel):
|
||||
tl1.x() + 1,
|
||||
tl1.y(),
|
||||
tailx - tl1.x() - 2,
|
||||
heigth,
|
||||
int(heigth),
|
||||
)
|
||||
xx = int(guesswidth1 - (tailx - tl1.x()))
|
||||
guesslinehead = None
|
||||
pos2 = tl3.x() + 1 - xx, tl3.y(), xx - 2, heigth
|
||||
pos2 = tl3.x() + 1 - xx, tl3.y(), xx - 2, int(heigth)
|
||||
if (
|
||||
globalconfig["usesearchword"]
|
||||
or globalconfig["usecopyword"]
|
||||
@ -559,7 +559,7 @@ class Textbrowser(QLabel):
|
||||
tl1.x() + 1,
|
||||
tl1.y(),
|
||||
tl2.x() - tl1.x() - 2,
|
||||
heigth,
|
||||
int(heigth),
|
||||
)
|
||||
if (
|
||||
globalconfig["usesearchword"]
|
||||
|
@ -954,7 +954,7 @@ class QUnFrameWindow(resizableframeless):
|
||||
wh = globalconfig["buttonsize"] * 1.5
|
||||
height = self.height() - wh
|
||||
|
||||
self.translate_text.resize(self.width(), height)
|
||||
self.translate_text.resize(self.width(), int(height))
|
||||
self.adjustbuttons()
|
||||
self._TitleLabel.setFixedWidth(self.width())
|
||||
|
||||
@ -1000,7 +1000,7 @@ class QUnFrameWindow(resizableframeless):
|
||||
sumwidth += button.width()
|
||||
leftstart = leftmax + (rightmax - leftmax - sumwidth) / 2
|
||||
for button in center:
|
||||
button.move(leftstart, 0)
|
||||
button.move(int(leftstart), 0)
|
||||
leftstart += button.width()
|
||||
|
||||
def callwrap(self, call, _):
|
||||
|
@ -186,10 +186,13 @@ def transferMsTTSData(rate, content, voice):
|
||||
# Extract binary data
|
||||
try:
|
||||
needle = b"Path:audio\r\n"
|
||||
start_ind = response.find(needle) + len(needle)
|
||||
idx = response.find(needle)
|
||||
if idx == -1:
|
||||
raise
|
||||
start_ind = idx + len(needle)
|
||||
audio_stream += response[start_ind:]
|
||||
except:
|
||||
pass
|
||||
audio_stream += response
|
||||
else:
|
||||
break
|
||||
ws.close()
|
||||
|
Loading…
x
Reference in New Issue
Block a user