[gtk/modern-testsuite: 17/23] ngl Fix bottom-right border render failure




commit 62954a033877d484b071f69459eda9c688063fa0
Author: Benjamin Otte <otte redhat com>
Date:   Thu Sep 16 02:28:56 2021 +0200

    ngl Fix bottom-right border render failure
    
    The wrong index was used for offsetting the bottom border rect.
    
    Test included.

 gsk/ngl/gsknglrenderjob.c                      |   2 +-
 testsuite/gsk/compare/border-bottom-right.node |   5 +++++
 testsuite/gsk/compare/border-bottom-right.png  | Bin 0 -> 103 bytes
 testsuite/gsk/meson.build                      |   1 +
 4 files changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/gsk/ngl/gsknglrenderjob.c b/gsk/ngl/gsknglrenderjob.c
index f819ac8d31..63da37b643 100644
--- a/gsk/ngl/gsknglrenderjob.c
+++ b/gsk/ngl/gsknglrenderjob.c
@@ -1734,7 +1734,7 @@ gsk_ngl_render_job_visit_rect_border_node (GskNglRenderJob     *job,
     {
       rgba_to_half (&colors[2], color);
       gsk_ngl_render_job_draw_rect_with_color (job,
-                                               &GRAPHENE_RECT_INIT (origin->x + widths[3], origin->y + 
size->height - widths[2], size->width - widths[1], widths[2]),
+                                               &GRAPHENE_RECT_INIT (origin->x + widths[3], origin->y + 
size->height - widths[2], size->width - widths[3], widths[2]),
                                                color);
     }
 
diff --git a/testsuite/gsk/compare/border-bottom-right.node b/testsuite/gsk/compare/border-bottom-right.node
new file mode 100644
index 0000000000..d71790a4f7
--- /dev/null
+++ b/testsuite/gsk/compare/border-bottom-right.node
@@ -0,0 +1,5 @@
+border {
+  colors: red;
+  outline: 0 0 20 20;
+  widths: 0 10 10 0;
+}
diff --git a/testsuite/gsk/compare/border-bottom-right.png b/testsuite/gsk/compare/border-bottom-right.png
new file mode 100644
index 0000000000..579f7efeb2
Binary files /dev/null and b/testsuite/gsk/compare/border-bottom-right.png differ
diff --git a/testsuite/gsk/meson.build b/testsuite/gsk/meson.build
index 5ba5f73520..a857646752 100644
--- a/testsuite/gsk/meson.build
+++ b/testsuite/gsk/meson.build
@@ -23,6 +23,7 @@ compare_render_tests = [
   'blend-difference',
   'blend-invisible-child',
   'blend-normal',
+  'border-bottom-right',
   'borders-rotated',
   'borders-scaled',
   'clip-coordinates-2d',


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]