mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 16:44:13 +08:00
fix
This commit is contained in:
parent
7a0d67ce92
commit
b2f72930d5
@ -61,14 +61,8 @@ class base(QLabel):
|
|||||||
dx, dy = self.moveoffset()
|
dx, dy = self.moveoffset()
|
||||||
text = self.text()
|
text = self.text()
|
||||||
isarabic = lambda char: (ord(char) >= 0x0600 and ord(char) <= 0x06E0)
|
isarabic = lambda char: (ord(char) >= 0x0600 and ord(char) <= 0x06E0)
|
||||||
isasciinoteng = (
|
isfirstara = lambda text: len(text) and isarabic(text[0])
|
||||||
lambda char: (ord(char) <= 0x40)
|
isarabicx = any(isarabic(char) for char in text) and isfirstara(text)
|
||||||
or ((ord(char) >= 0x5B) and (ord(char) <= 0x60))
|
|
||||||
or ((ord(char) >= 0x7B) and (ord(char) <= 0x7F))
|
|
||||||
)
|
|
||||||
isarabicx = any(isarabic(char) for char in text) and all(
|
|
||||||
(isasciinoteng(char) or isarabic(char)) for char in text
|
|
||||||
)
|
|
||||||
|
|
||||||
if isarabicx:
|
if isarabicx:
|
||||||
self.movedx -= self.width()
|
self.movedx -= self.width()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user