Ticket #12424: 0010-MythUI-Don-t-draw-empty-text.patch

File 0010-MythUI-Don-t-draw-empty-text.patch, 1.1 KB (added by Roger Siddons <dizygotheca@…>, 5 years ago)
  • mythtv/libs/libmythui/mythuitext.cpp

    From 61128e3020b1df8b6008cf9bdf6a5161f3104082 Mon Sep 17 00:00:00 2001
    From: Roger Siddons <dizygotheca@ntlworld.com>
    Date: Thu, 27 Aug 2015 18:58:27 +0100
    Subject: [PATCH 10/15] MythUI: Don't draw empty text
    Text that doesn't fit into a UI item for some reason results in errors:
    QPainter::begin: Paint device returned engine == 0, type: 3
    2015-10-10 16:50:23.512923 E  MythPainter::GetImageFromTextLayout: Invalid canvas.
    2015-10-10 16:50:23.512939 D  MythPainter::DrawTextLayout: Rendered image is null.
    The QRect created by the formatting is empty but not null and we shouldn't try to render it.
    diff --git a/mythtv/libs/libmythui/mythuitext.cpp b/mythtv/libs/libmythui/mythuitext.cpp
    index 9a498cc..52405a5 100644
    a b void MythUIText::ShiftCanvas(int x, int y) 
    406406void MythUIText::DrawSelf(MythPainter *p, int xoffset, int yoffset,
    407407                          int alphaMod, QRect clipRect)
    409     if (m_Canvas.isNull())
     409    if (m_Canvas.isEmpty())
    410410        return;
    412412    FormatVector formats;