[gtksourceview] map: fix a critical for negative size allocation
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview] map: fix a critical for negative size allocation
- Date: Sat, 19 Jun 2021 03:22:37 +0000 (UTC)
commit 3eead2806256f502126168c8bab9baf149a4753b
Author: Christian Hergert <chergert redhat com>
Date: Fri Jun 18 20:47:04 2021 -0700
map: fix a critical for negative size allocation
gtksourceview/gtksourcemap.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
---
diff --git a/gtksourceview/gtksourcemap.c b/gtksourceview/gtksourcemap.c
index 96dc4246..9d71b1a5 100644
--- a/gtksourceview/gtksourcemap.c
+++ b/gtksourceview/gtksourcemap.c
@@ -300,11 +300,7 @@ update_scrubber_position (GtkSourceMap *map)
(gdouble)view_height *
(gdouble)child_height) +
iter_area.height;
-
- if (scrubber_area.height > alloc.height)
- {
- scrubber_area.height = alloc.height;
- }
+ scrubber_area.height = CLAMP (scrubber_area.height, 1, alloc.height);
if (memcmp (&scrubber_area, &priv->scrubber_area, sizeof scrubber_area) != 0)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]