Fix Y-axis rotation

This commit is contained in:
Star Brilliant 2013-11-24 12:59:09 +08:00
parent aefd39014c
commit 2f8f4cf63f

View File

@ -290,6 +290,9 @@ def WriteCommentBilibiliPositioned(f, c, width, height, styleid):
if rotate_z != 0: if rotate_z != 0:
styles.append('\\frz%s' % rotate_z) styles.append('\\frz%s' % rotate_z)
if rotate_y != 0: if rotate_y != 0:
styles.append('\\frx%s' % (rotate_y*math.sin(rotate_z*math.pi/180)))
styles.append('\\fry%s' % (rotate_y*math.cos(rotate_z*math.pi/180)))
elif rotate_y != 0:
styles.append('\\fry%s' % rotate_y) styles.append('\\fry%s' % rotate_y)
if fontface: if fontface:
styles.append('\\fn%s' % fontface.replace('\\', '\\\\').replace('{', '\\{').replace('}', '\\}')) styles.append('\\fn%s' % fontface.replace('\\', '\\\\').replace('{', '\\{').replace('}', '\\}'))