Commit b843331a authored by Sebastian Ramacher's avatar Sebastian Ramacher
Browse files

+1/-1 when storing/loading pages

parent b380f6f1
......@@ -180,7 +180,7 @@ zathura_db_set_fileinfo(zathura_database_t* db, const char* file, unsigned int p
g_return_val_if_fail(db && file, false);
static const char SQL_FILEINFO_SET[] =
"REPLACE INTO fileinfo (file, page, offset, scale) VALUES (?, ?, ?);";
"REPLACE INTO fileinfo (file, page, offset, scale) VALUES (?, ?, ?, ?);";
sqlite3_stmt* stmt = prepare_statement(db->session, SQL_FILEINFO_SET);
if (stmt == NULL) {
......
......@@ -344,7 +344,7 @@ document_open(zathura_t* zathura, const char* path, const char* password)
int offset = 0;
float scale = 1.0f;
if (zathura_db_get_fileinfo(zathura->database, zathura->document->file_path, &page, &offset, &scale)) {
page_set_delayed(zathura, page);
page_set_delayed(zathura, page - 1);
zathura->document->scale = scale;
}
......@@ -398,7 +398,7 @@ document_close(zathura_t* zathura)
}
/* store last seen page */
zathura_db_set_fileinfo(zathura->database, zathura->document->file_path, zathura->document->current_page_number,
zathura_db_set_fileinfo(zathura->database, zathura->document->file_path, zathura->document->current_page_number + 1,
/* zathura->document->offset TODO */ 0, zathura->document->scale);
render_free(zathura->sync.render_thread);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment