Commit 12c8cd91 authored by Sebastian Ramacher's avatar Sebastian Ramacher

Merge branch 'release/0.4.7' into master

parents 91ceee2b 65344f61
Pipeline #319 canceled with stages
project('zathura', 'c',
version: '0.4.6',
version: '0.4.7',
meson_version: '>=0.47',
default_options: ['c_std=c11', 'warning_level=3'],
)
......
......@@ -8,8 +8,8 @@ msgid ""
msgstr ""
"Project-Id-Version: zathura\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-07-27 10:06+0200\n"
"PO-Revision-Date: 2020-07-27 10:09+0200\n"
"POT-Creation-Date: 2020-08-24 21:36+0200\n"
"PO-Revision-Date: 2020-07-27 08:12+0000\n"
"Last-Translator: Sebastian Ramacher <sebastian+dev@ramacher.at>\n"
"Language-Team: German (http://www.transifex.com/pwmt/zathura/language/de/)\n"
"Language: de\n"
......@@ -664,7 +664,7 @@ msgstr "In einem Nicht-Standardmodus starten"
#: zathura/main.c:160
msgid "Search for the given phrase and display results"
msgstr "Suche nach der gegeben Phrase und anzeigen der Ergebnisse"
msgstr "Suche nach der gegeben Phrase und anzeigen der Ergebnisse"
#: zathura/page-widget.c:654
msgid "Loading..."
......
This diff is collapsed.
......@@ -24,15 +24,17 @@ if check.found()
test('session', session,
timeout: 60*60
)
sandbox = executable('test_sandbox', ['test_sandbox.c', 'tests.c'],
dependencies: build_dependencies + test_dependencies,
include_directories: include_directories,
c_args: defines + flags
)
test('sandbox', sandbox,
timeout: 60*60
)
if seccomp.found()
sandbox = executable('test_sandbox', ['test_sandbox.c', 'tests.c'],
dependencies: build_dependencies + test_dependencies,
include_directories: include_directories,
c_args: defines + flags
)
test('sandbox', sandbox,
timeout: 60*60
)
endif
utils = executable('test_utils', ['test_utils.c', 'tests.c'],
dependencies: build_dependencies + test_dependencies,
......
......@@ -895,7 +895,7 @@ zathura_plaindatabase_class_init(ZathuraPlainDatabaseClass* class)
object_class->set_property = plain_set_property;
g_object_class_install_property(object_class, PROP_PATH,
g_param_spec_string("path", "path", "path to directory where the bookmarks and history are locates",
g_param_spec_string("path", "path", "path to directory where the bookmarks and history are located",
NULL, G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS));
}
......
......@@ -313,8 +313,8 @@ running_under_wsl(void)
typedef struct zathura_point_s
{
double x;
double y;
unsigned int x;
unsigned int y;
} zathura_point_t;
static int
......@@ -322,13 +322,31 @@ cmp_point(const void* va, const void* vb) {
const zathura_point_t* a = va;
const zathura_point_t* b = vb;
return a->x == b->x && a->y == b->y ? 0 : -1;
if (a->x == b->x) {
if (a->y == b->y) {
return 0;
}
return a->y < b->y ? -1 : 1;
}
return a->x < b->x ? -1 : 1;
}
static unsigned int
ufloor(double f) {
return floor(f);
}
static unsigned int
uceil(double f) {
return ceil(f);
}
static int
cmp_double(const void* vx, const void* vy) {
const double* x = vx;
const double* y = vy;
cmp_uint(const void* vx, const void* vy) {
const unsigned int* x = vx;
const unsigned int* y = vy;
return *x == *y ? 0 : (*x > *y ? 1 : -1);
}
......@@ -338,8 +356,8 @@ cmp_rectangle(const void* vr1, const void* vr2) {
const zathura_rectangle_t* r1 = vr1;
const zathura_rectangle_t* r2 = vr2;
return (r1->x1 == r2->x1 && r1->x2 == r2->x2 && r1->y1 == r2->y1 &&
r1->y2 == r2->y2)
return (ufloor(r1->x1) == ufloor(r2->x1) && uceil(r1->x2) == uceil(r2->x2) &&
ufloor(r1->y1) == ufloor(r2->y1) && uceil(r1->y2) == uceil(r2->y2))
? 0
: -1;
}
......@@ -356,7 +374,7 @@ girara_list_append_unique(girara_list_t* l, girara_compare_function_t cmp, void*
}
static void
append_unique_point(girara_list_t* list, const double x, const double y) {
append_unique_point(girara_list_t* list, const unsigned int x, const unsigned int y) {
zathura_point_t* p = g_try_malloc(sizeof(zathura_point_t));
if (p == NULL) {
return;
......@@ -375,22 +393,22 @@ rectangle_to_points(void* vrect, void* vlist) {
const zathura_rectangle_t* rect = vrect;
girara_list_t* list = vlist;
append_unique_point(list, rect->x1, rect->y1);
append_unique_point(list, rect->x1, rect->y2);
append_unique_point(list, rect->x2, rect->y1);
append_unique_point(list, rect->x2, rect->y2);
append_unique_point(list, ufloor(rect->x1), ufloor(rect->y1));
append_unique_point(list, ufloor(rect->x1), uceil(rect->y2));
append_unique_point(list, uceil(rect->x2), ufloor(rect->y1));
append_unique_point(list, uceil(rect->x2), uceil(rect->y2));
}
static void
append_unique_double(girara_list_t* list, const double v) {
double* p = g_try_malloc(sizeof(double));
append_unique_uint(girara_list_t* list, const unsigned int v) {
double* p = g_try_malloc(sizeof(v));
if (p == NULL) {
return;
}
*p = v;
if (girara_list_append_unique(list, cmp_double, p) == false) {
if (girara_list_append_unique(list, cmp_uint, p) == false) {
g_free(p);
}
}
......@@ -399,24 +417,24 @@ append_unique_double(girara_list_t* list, const double v) {
static void
cut_rectangle(const zathura_rectangle_t* rect, girara_list_t* points, girara_list_t* rectangles) {
// Lists of ordred relevant points
girara_list_t* xs = girara_sorted_list_new2(cmp_double, g_free);
girara_list_t* ys = girara_sorted_list_new2(cmp_double, g_free);
girara_list_t* xs = girara_sorted_list_new2(cmp_uint, g_free);
girara_list_t* ys = girara_sorted_list_new2(cmp_uint, g_free);
append_unique_double(xs, rect->x2);
append_unique_double(ys, rect->y2);
append_unique_uint(xs, uceil(rect->x2));
append_unique_uint(ys, uceil(rect->y2));
GIRARA_LIST_FOREACH(points, zathura_point_t*, i_pt, pt)
if (pt->x > rect->x1 && pt->x < rect->x2) {
append_unique_double(xs, pt->x);
if (pt->x > ufloor(rect->x1) && pt->x < uceil(rect->x2)) {
append_unique_uint(xs, pt->x);
}
if (pt->y > rect->y1 && pt->y < rect->y2) {
append_unique_double(ys, pt->y);
if (pt->y > ufloor(rect->y1) && pt->y < uceil(rect->y2)) {
append_unique_uint(ys, pt->y);
}
GIRARA_LIST_FOREACH_END(points, zathura_point_t*, i_pt, pt);
double x = rect->x1;
double x = ufloor(rect->x1);
GIRARA_LIST_FOREACH(xs, const double*, ix, cx)
double y = rect->y1;
double y = ufloor(rect->y1);
GIRARA_LIST_FOREACH(ys, const double*, iy, cy)
zathura_rectangle_t* r = g_try_malloc(sizeof(zathura_rectangle_t));
*r = (zathura_rectangle_t) {x, y, *cx, *cy};
......
......@@ -1685,7 +1685,7 @@ adjust_view(zathura_t* zathura)
zathura_document_get_document_size(zathura->document, &document_height, &document_width);
zathura_document_get_viewport_size(zathura->document, &view_height, &view_width);
if (view_height == 0 || view_width == 0 || cell_height == 0 || cell_width == 0) {
if (view_height == 0 || view_width == 0 || cell_height == 0 || cell_width == 0 || document_width == 0) {
goto error_ret;
}
......
Markdown is supported
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