1
0
mirror of https://github.com/ciromattia/kcc synced 2026-04-23 01:19:50 +00:00

remove getTopMargin from EPUBs

This commit is contained in:
Alex Xu
2026-04-22 16:25:15 -07:00
parent a7a9f35686
commit f97398d481

View File

@@ -136,7 +136,7 @@ def buildHTML(path, imgfile, imgfilepath, imgfile2=None):
"content=\"width=" + str(imgsizeframe[0]) + ", height=" + str(imgsizeframe[1]) + "\"/>\n"
"</head>\n",
"<body style=\"" + additionalStyle + "\">\n",
"<div style=\"text-align:center;top:" + getTopMargin(deviceres, imgsizeframe) + "%;\">\n",
"<div style=\"text-align:center;\">\n",
])
if options.iskindle:
# this display none div fixes formatting issues with virtual panel mode, for some reason
@@ -1075,11 +1075,6 @@ def getDirectorySize(start_path='.'):
return total_size
def getTopMargin(deviceres, size):
y = int((deviceres[1] - size[1]) / 2) / deviceres[1] * 100
return str(round(y, 1))
def getPanelViewResolution(imagesize, deviceres):
scale = float(deviceres[0]) / float(imagesize[0])
return int(deviceres[0]), int(scale * imagesize[1])