From 174345b445ca1e6276b2150d15f9fcaf4ab0dacc Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 9 Jun 2000 14:41:34 +0000 Subject: [PATCH] added test for inverted text git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7549 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/drawing/drawing.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/samples/drawing/drawing.cpp b/samples/drawing/drawing.cpp index 058677506d..44b92db410 100644 --- a/samples/drawing/drawing.cpp +++ b/samples/drawing/drawing.cpp @@ -815,7 +815,7 @@ void MyCanvas::DrawText(wxDC& dc) dc.SetFont( *wxNORMAL_FONT ); wxString text; - dc. SetBackgroundMode(wxTRANSPARENT); + dc.SetBackgroundMode(wxTRANSPARENT); for ( int n = -180; n < 180; n += 30 ) { @@ -840,16 +840,22 @@ void MyCanvas::DrawText(wxDC& dc) dc.DrawRectangle( 100, 40, 4, height ); // test the logical function effect + wxCoord y = 150; dc.SetLogicalFunction(wxINVERT); - dc.DrawText( "not inverted", 110, 150 ); - dc.DrawRectangle( 110, 160, 100, height ); + dc.DrawText( "There should be no text below", 110, 150 ); + dc.DrawRectangle( 110, y, 100, height ); // twice drawn inverted should result in invisible - dc.DrawText( "should be invisible", 110, 170 ); - dc.DrawRectangle( 110, 200, 100, height ); - dc.DrawText( "should be invisible", 110, 170 ); - dc.DrawRectangle( 110, 200, 100, height ); + y += height; + dc.DrawText( "Invisible text", 110, y ); + dc.DrawRectangle( 110, y, 100, height ); + dc.DrawText( "Invisible text", 110, y ); + dc.DrawRectangle( 110, y, 100, height ); dc.SetLogicalFunction(wxCOPY); + + y += height; + dc.DrawRectangle( 110, y, 100, height ); + dc.DrawText( "Visible text", 110, y ); } static const struct