summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-08-28 15:42:30 -0400
committerMatthias Clasen <mclasen@redhat.com>2021-08-28 15:42:30 -0400
commit1cfd340caeaab4f3f9ef72ac78f4486359f1fe6c (patch)
tree69f07cd7ad43a8e17c4656451ade98e0889ed5c4
parent2db8d7f6a2b225d801d443618143d7dff3ba9cf4 (diff)
downloadgtk+-1cfd340caeaab4f3f9ef72ac78f4486359f1fe6c.tar.gz
ngl: Avoid a coordinate overflowtext-selection-missing
This was showing up as big text selections going missing sporadically. Fixes: #4214
-rw-r--r--gsk/ngl/gsknglrenderjob.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gsk/ngl/gsknglrenderjob.c b/gsk/ngl/gsknglrenderjob.c
index 532157d1be..ef4d075997 100644
--- a/gsk/ngl/gsknglrenderjob.c
+++ b/gsk/ngl/gsknglrenderjob.c
@@ -1408,7 +1408,10 @@ gsk_ngl_render_job_visit_color_node (GskNglRenderJob *job,
program = CHOOSE_PROGRAM (job, coloring);
batch = gsk_ngl_command_queue_get_batch (job->command_queue);
- if (batch->any.kind == GSK_NGL_COMMAND_KIND_DRAW &&
+ /* Limit the size, or we end up with a coordinate overflow somwhere. */
+ if (node->bounds.size.width < 300 &&
+ node->bounds.size.height < 300 &&
+ batch->any.kind == GSK_NGL_COMMAND_KIND_DRAW &&
batch->any.program == program->id)
{
GskNglRenderOffscreen offscreen = {0};