Modify GetZoomFactor

This commit is contained in:
Star Brilliant 2013-11-17 14:00:45 +08:00
parent 1b3b33b493
commit 89037da921

View File

@ -216,8 +216,7 @@ CommentFormatMap = {None: None, 'Niconico': ReadCommentsNiconico, 'Acfun': ReadC
def WriteCommentBilibiliPositioned(f, c, width, height, styleid): def WriteCommentBilibiliPositioned(f, c, width, height, styleid):
BiliPlayerSize = (672, 437) BiliPlayerSize = (672, 438)
BiliPlayerAspect = 672/437
def GetZoomFactor(TargetSize): def GetZoomFactor(TargetSize):
try: try:
@ -227,6 +226,7 @@ def WriteCommentBilibiliPositioned(f, c, width, height, styleid):
pass pass
GetZoomFactor.Cached_TargetSize = TargetSize GetZoomFactor.Cached_TargetSize = TargetSize
try: try:
BiliPlayerAspect = BiliPlayerSize[0]/BiliPlayerSize[1]
TargetAspect = TargetSize[0]/TargetSize[1] TargetAspect = TargetSize[0]/TargetSize[1]
if TargetAspect < BiliPlayerAspect: # narrower if TargetAspect < BiliPlayerAspect: # narrower
ScaleFactor = TargetSize[0]/BiliPlayerSize[0] ScaleFactor = TargetSize[0]/BiliPlayerSize[0]