This commit is contained in:
恍兮惚兮 2024-03-24 19:09:10 +08:00
parent fb1ba27830
commit eb9849391c
2 changed files with 6 additions and 8 deletions

View File

@ -363,9 +363,6 @@ class Textbrowser( ):
wwww=self.parent.width() wwww=self.parent.width()
for word in x: for word in x:
idx+=1 idx+=1
if word['orig']=='\n':
guesslinehead=None
continue
l=len(word['orig']) l=len(word['orig'])
tl1=self.textbrowser.cursorRect(self.textcursor).topLeft() tl1=self.textbrowser.cursorRect(self.textcursor).topLeft()
@ -526,8 +523,6 @@ class Textbrowser( ):
x=self.nearmerge(x,pos,fonthira,fontorig) x=self.nearmerge(x,pos,fonthira,fontorig)
self.settextposcursor(pos) self.settextposcursor(pos)
for word in x: for word in x:
if word['orig']=='\n':
continue
l=len(word['orig']) l=len(word['orig'])
tl1=self.textbrowser.cursorRect(self.textcursor).topLeft() tl1=self.textbrowser.cursorRect(self.textcursor).topLeft()
@ -562,8 +557,7 @@ class Textbrowser( ):
word['hira_w']=_metrichira.width(word['hira']) word['hira_w']=_metrichira.width(word['hira'])
#print(word['hira'],word['hira_w']) #print(word['hira'],word['hira_w'])
newline.append(word) newline.append(word)
if word['orig']=='\n':
continue
l=len(word['orig']) l=len(word['orig'])
tl1=self.textbrowser.cursorRect(self.textcursor).topLeft() tl1=self.textbrowser.cursorRect(self.textcursor).topLeft()
self.settextposcursor(pos+l) self.settextposcursor(pos+l)

View File

@ -169,7 +169,11 @@ class QUnFrameWindow(resizableframeless):
return return
text=self.cleartext(text) text=self.cleartext(text)
if hira: if hira:
hira=self.parsehira(text) hiras=[self.parsehira(_) for _ in text.split('\n')]
hira=[]
for i,_h in enumerate(hiras):
if i: hira+=[{'orig':'\n','hira':'\n'}]
hira+=_h
else: else:
hira=[] hira=[]
self.translate_text.setnextfont(origin) self.translate_text.setnextfont(origin)