mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2025-01-01 03:06:01 +01:00
+1/-1 when storing/loading pages
This commit is contained in:
parent
b380f6f14b
commit
b843331afc
2 changed files with 3 additions and 3 deletions
|
@ -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);
|
g_return_val_if_fail(db && file, false);
|
||||||
|
|
||||||
static const char SQL_FILEINFO_SET[] =
|
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);
|
sqlite3_stmt* stmt = prepare_statement(db->session, SQL_FILEINFO_SET);
|
||||||
if (stmt == NULL) {
|
if (stmt == NULL) {
|
||||||
|
|
|
@ -344,7 +344,7 @@ document_open(zathura_t* zathura, const char* path, const char* password)
|
||||||
int offset = 0;
|
int offset = 0;
|
||||||
float scale = 1.0f;
|
float scale = 1.0f;
|
||||||
if (zathura_db_get_fileinfo(zathura->database, zathura->document->file_path, &page, &offset, &scale)) {
|
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;
|
zathura->document->scale = scale;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -398,7 +398,7 @@ document_close(zathura_t* zathura)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* store last seen page */
|
/* 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);
|
/* zathura->document->offset TODO */ 0, zathura->document->scale);
|
||||||
|
|
||||||
render_free(zathura->sync.render_thread);
|
render_free(zathura->sync.render_thread);
|
||||||
|
|
Loading…
Reference in a new issue