Compare commits

..

No commits in common. "5f8d8873b311348ced29a0d4119fb3b9c361128d" and "c1df87582d08202f53217b5de92b1bfc510446c6" have entirely different histories.

3 changed files with 8 additions and 17 deletions

View File

@ -31,11 +31,6 @@
background-color: black; background-color: black;
} }
/* Reset images style to avoid external CSS interfering */
#melpomene img {
all: initial;
}
#melpomene-content-frame { #melpomene-content-frame {
position: relative; position: relative;
flex: 1; flex: 1;

View File

@ -180,11 +180,11 @@ function getPagesCount() {
} }
function pageOriginalHeight(pageNumber) { function pageOriginalHeight(pageNumber) {
return READER_PAGES.children[pageNumber - 1].naturalHeight return READER_PAGES.children[pageNumber - 1].height
} }
function pageOriginalWidth(pageNumber) { function pageOriginalWidth(pageNumber) {
return READER_PAGES.children[pageNumber - 1].naturalWidth return READER_PAGES.children[pageNumber - 1].width
} }
function readerFrameRatio() { function readerFrameRatio() {
@ -192,15 +192,15 @@ function readerFrameRatio() {
} }
function pageRatio(pageNumber) { function pageRatio(pageNumber) {
return READER_PAGES.children[pageNumber - 1].naturalWidth / READER_PAGES.children[pageNumber - 1].naturalHeight return READER_PAGES.children[pageNumber - 1].width / READER_PAGES.children[pageNumber - 1].height
} }
function pageMaxHeight(){ function pageMaxHeight(){
let max_height = 0 let max_height = 0
for (var i = 0; i < READER_PAGES.children.length; i++) { for (var i = 0; i < READER_PAGES.children.length; i++) {
if(READER_PAGES.children[i].naturalHeight > max_height){ if(READER_PAGES.children[i].height > max_height){
max_height = READER_PAGES.children[i].naturalHeight max_height = READER_PAGES.children[i].height
} }
} }
@ -217,7 +217,7 @@ function previousPagesWidth(pageNumber) {
let totalWidth = 0 let totalWidth = 0
for (let idx = 0; idx < pageNumber - 1; idx++){ for (let idx = 0; idx < pageNumber - 1; idx++){
totalWidth = totalWidth + READER_PAGES.children[idx].naturalWidth totalWidth = totalWidth + READER_PAGES.children[idx].width
} }
return totalWidth return totalWidth

View File

@ -40,12 +40,8 @@ def extract_zooms(src_folder):
tree = ET.parse(svg_path) tree = ET.parse(svg_path)
root = tree.getroot() root = tree.getroot()
if "." in root.get("width"): zooms[idx]["width"] = int(root.get("width"))
print(f"WARNING: file {svg_path} has a floating width, it will be rounded", file=sys.stderr) zooms[idx]["height"] = int(root.get("height"))
zooms[idx]["width"] = round(float(root.get("width")))
if "." in root.get("height"):
print(f"WARNING: file {svg_path} has a floating height, it will be rounded", file=sys.stderr)
zooms[idx]["height"] = round(float(root.get("height")))
for area in root.findall('.//{*}rect'): for area in root.findall('.//{*}rect'):
zooms[idx]["zooms"].append([ zooms[idx]["zooms"].append([