mirror of
https://invent.kde.org/graphics/okular
synced 2024-10-28 19:28:38 +00:00
do not draw text in some situations the XPS spec tell us to not do that:
- missing Fill attribute and Glyphs.Fill child element - brush color with alpha == 0 - Opacity attribute explicitely 0 svn path=/trunk/KDE/kdegraphics/okular/; revision=825375
This commit is contained in:
parent
046637703b
commit
018045758f
1 changed files with 17 additions and 2 deletions
|
@ -757,10 +757,18 @@ void XpsHandler::processGlyph( XpsRenderNode &node )
|
|||
brush = * data;
|
||||
delete data;
|
||||
} else {
|
||||
brush = QBrush();
|
||||
// no "Fill" attribute and no "Glyphs.Fill" child, so show nothing
|
||||
// (see XPS specs, 5.10)
|
||||
m_painter->restore();
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
brush = parseRscRefColorForBrush( att );
|
||||
if ( brush.style() > Qt::NoBrush && brush.style() < Qt::LinearGradientPattern
|
||||
&& brush.color().alpha() == 0 ) {
|
||||
m_painter->restore();
|
||||
return;
|
||||
}
|
||||
}
|
||||
m_painter->setBrush( brush );
|
||||
m_painter->setPen( QPen( brush, 0 ) );
|
||||
|
@ -768,7 +776,14 @@ void XpsHandler::processGlyph( XpsRenderNode &node )
|
|||
// Opacity
|
||||
att = node.attributes.value("Opacity");
|
||||
if (! att.isEmpty()) {
|
||||
m_painter->setOpacity(att.toDouble());
|
||||
bool ok = true;
|
||||
double value = att.toDouble( &ok );
|
||||
if ( ok && value >= 0.1 ) {
|
||||
m_painter->setOpacity( value );
|
||||
} else {
|
||||
m_painter->restore();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//RenderTransform
|
||||
|
|
Loading…
Reference in a new issue