mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
parent
99594147b1
commit
238d0a0f9e
@ -158,6 +158,12 @@ bool QgsPaintEffectRegistry::isDefaultStack( QgsPaintEffect *effect )
|
||||
if ( !dynamic_cast< QgsInnerGlowEffect * >( effectStack->effect( 4 ) ) )
|
||||
return false;
|
||||
|
||||
//we don't go as far as to check the individual effect's properties
|
||||
QgsDrawSourceEffect *sourceEffect = static_cast< QgsDrawSourceEffect * >( effectStack->effect( 2 ) );
|
||||
if ( !qgsDoubleNear( sourceEffect->opacity(), 1.0 ) )
|
||||
return false;
|
||||
if ( sourceEffect->blendMode() != QPainter::CompositionMode_SourceOver )
|
||||
return false;
|
||||
|
||||
//we don't go as far as to check disabled effect's properties
|
||||
return true;
|
||||
}
|
||||
|
@ -174,6 +174,14 @@ void TestQgsPaintEffectRegistry::defaultStack()
|
||||
QgsPaintEffect *effect2 = new DummyPaintEffect();
|
||||
QVERIFY( !registry->isDefaultStack( effect2 ) );
|
||||
delete effect2;
|
||||
|
||||
effect = static_cast<QgsEffectStack *>( registry->defaultStack() );
|
||||
static_cast< QgsDrawSourceEffect * >( effect->effect( 2 ) )->setOpacity( 0.5 );
|
||||
QVERIFY( !registry->isDefaultStack( effect ) );
|
||||
static_cast< QgsDrawSourceEffect * >( effect->effect( 2 ) )->setOpacity( 1.0 );
|
||||
QVERIFY( registry->isDefaultStack( effect ) );
|
||||
static_cast< QgsDrawSourceEffect * >( effect->effect( 2 ) )->setBlendMode( QPainter::CompositionMode_Lighten );
|
||||
QVERIFY( !registry->isDefaultStack( effect ) );
|
||||
}
|
||||
|
||||
QGSTEST_MAIN( TestQgsPaintEffectRegistry )
|
||||
|
Loading…
x
Reference in New Issue
Block a user