|
From: <and...@us...> - 2008-07-22 12:47:17
|
Revision: 8556
http://plplot.svn.sourceforge.net/plplot/?rev=8556&view=rev
Author: andrewross
Date: 2008-07-22 12:47:26 +0000 (Tue, 22 Jul 2008)
Log Message:
-----------
Make several implicit castings between different types (PLINT, PLFLT,
wxCoord) explict. This fixes the warnings generated by gcc.
Modified Paths:
--------------
trunk/drivers/wxwidgets_dc.cpp
Modified: trunk/drivers/wxwidgets_dc.cpp
===================================================================
--- trunk/drivers/wxwidgets_dc.cpp 2008-07-22 12:33:15 UTC (rev 8555)
+++ trunk/drivers/wxwidgets_dc.cpp 2008-07-22 12:47:26 UTC (rev 8556)
@@ -253,12 +253,13 @@
wxString str(wxConvUTF8.cMB2WC(utf8_string), *wxConvCurrent);
m_dc->GetTextExtent( str, &w, &h, &d, &l );
if( drawText )
- m_dc->DrawRotatedText( str, (posX-yOffset*sin_rot)/scalex,
- height-(posY+yOffset*cos_rot)/scaley, rotation*180.0/M_PI );
- posX += w*scalex*cos_rot;
- posY += w*scalex*sin_rot;
+ m_dc->DrawRotatedText( str, (wxCoord) ((posX-yOffset*sin_rot)/scalex),
+ (wxCoord) (height-(posY+yOffset*cos_rot)/scaley),
+ rotation*180.0/M_PI );
+ posX += (PLINT) (w*scalex*cos_rot);
+ posY += (PLINT) (w*scalex*sin_rot);
textWidth += w;
- textHeight = textHeight>(h+yOffset/scaley) ? textHeight : (h+yOffset/scaley);
+ textHeight = (wxCoord) (textHeight>(h+yOffset/scaley) ? textHeight : (h+yOffset/scaley));
memset( utf8_string, '\0', max_string_length );
}
@@ -272,7 +273,7 @@
plP_fci2hex( fci, &fontWeight, PL_FCI_WEIGHT );
if( m_font )
delete m_font;
- m_font=wxFont::New(fontSize*fontScale, fontFamilyLookup[fontFamily],
+ m_font=wxFont::New((int) (fontSize*fontScale), fontFamilyLookup[fontFamily],
fontStyleLookup[fontStyle] & fontWeightLookup[fontWeight] );
m_font->SetUnderlined( underlined );
m_dc->SetFont( *m_font );
@@ -311,8 +312,8 @@
posY = args->y;
PSDrawText( args->unicode_array, args->unicode_array_len, false );
- posX = args->x-(args->just*textWidth)*scalex*cos_rot-(0.5*textHeight)*scalex*sin_rot;
- posY = args->y-(args->just*textWidth)*scaley*sin_rot+(0.5*textHeight)*scaley*cos_rot;
+ posX = (PLINT) (args->x-(args->just*textWidth)*scalex*cos_rot-(0.5*textHeight)*scalex*sin_rot);
+ posY = (PLINT) (args->y-(args->just*textWidth)*scaley*sin_rot+(0.5*textHeight)*scaley*cos_rot);
PSDrawText( args->unicode_array, args->unicode_array_len, true );
AddtoClipRegion( 0, 0, width, height );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sm...@us...> - 2008-11-19 15:51:08
|
Revision: 8999
http://plplot.svn.sourceforge.net/plplot/?rev=8999&view=rev
Author: smekal
Date: 2008-11-19 15:51:00 +0000 (Wed, 19 Nov 2008)
Log Message:
-----------
Fixed a bug which only on Mac OS X prevented plots from being updated.
Modified Paths:
--------------
trunk/drivers/wxwidgets_dc.cpp
Modified: trunk/drivers/wxwidgets_dc.cpp
===================================================================
--- trunk/drivers/wxwidgets_dc.cpp 2008-11-19 15:34:01 UTC (rev 8998)
+++ trunk/drivers/wxwidgets_dc.cpp 2008-11-19 15:51:00 UTC (rev 8999)
@@ -145,7 +145,8 @@
for( int i=0; i < pls->dev_npts; i++ ) {
points[i].x=(int)(pls->dev_x[i]/scalex);
points[i].y=(int)(height-pls->dev_y[i]/scaley);
- AddtoClipRegion( points[i-1].x, points[i-1].y, points[i].x, points[i].y );
+ if(i>0)
+ AddtoClipRegion( points[i-1].x, points[i-1].y, points[i].x, points[i].y );
}
m_dc->DrawPolygon( pls->dev_npts, points );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sm...@us...> - 2008-11-20 09:28:07
|
Revision: 9005
http://plplot.svn.sourceforge.net/plplot/?rev=9005&view=rev
Author: smekal
Date: 2008-11-20 09:28:03 +0000 (Thu, 20 Nov 2008)
Log Message:
-----------
Comments on functions added and improved.
Modified Paths:
--------------
trunk/drivers/wxwidgets_dc.cpp
Modified: trunk/drivers/wxwidgets_dc.cpp
===================================================================
--- trunk/drivers/wxwidgets_dc.cpp 2008-11-20 09:24:38 UTC (rev 9004)
+++ trunk/drivers/wxwidgets_dc.cpp 2008-11-20 09:28:03 UTC (rev 9005)
@@ -41,12 +41,12 @@
#include "wxwidgets.h"
-/*--------------------------------------------------------------------------*\
+/*--------------------------------------------------------------------------
* wxPLDevDC::wxPLDevDC( void )
*
* Constructor of the standard wxWidgets device based on the wxPLDevBase
* class. Only some initialisations are done.
-\*--------------------------------------------------------------------------*/
+ *--------------------------------------------------------------------------*/
wxPLDevDC::wxPLDevDC( void ) : wxPLDevBase()
{
m_dc=NULL;
@@ -56,11 +56,11 @@
}
-/*--------------------------------------------------------------------------*\
+/*--------------------------------------------------------------------------
* wxPLDevDC::~wxPLDevDC( void )
*
* The deconstructor frees memory allocated by the device.
-\*--------------------------------------------------------------------------*/
+ *--------------------------------------------------------------------------*/
wxPLDevDC::~wxPLDevDC()
{
if( ownGUI ) {
@@ -77,11 +77,11 @@
}
-/*--------------------------------------------------------------------------*\
+/*--------------------------------------------------------------------------
* void wxPLDevDC::DrawLine( short x1a, short y1a, short x2a, short y2a )
*
* Draw a line from (x1a, y1a) to (x2a, y2a).
-\*--------------------------------------------------------------------------*/
+ *--------------------------------------------------------------------------*/
void wxPLDevDC::DrawLine( short x1a, short y1a, short x2a, short y2a )
{
x1a=(short)(x1a/scalex); y1a=(short)(height-y1a/scaley);
@@ -93,11 +93,11 @@
}
-/*--------------------------------------------------------------------------*\
+/*--------------------------------------------------------------------------
* void wxPLDevDC::DrawPolyline( short *xa, short *ya, PLINT npts )
*
* Draw a poly line - coordinates are in the xa and ya arrays.
-\*--------------------------------------------------------------------------*/
+ *--------------------------------------------------------------------------*/
void wxPLDevDC::DrawPolyline( short *xa, short *ya, PLINT npts )
{
wxCoord x1a, y1a, x2a, y2a;
@@ -116,6 +116,12 @@
}
+/*--------------------------------------------------------------------------
+ * void wxPLDevDC::ClearBackground( PLINT bgr, PLINT bgg, PLINT bgb,
+ * PLINT x1, PLINT y1, PLINT x2, PLINT y2 )
+ *
+ * Clear parts ((x1,y1) to (x2,y2)) of the background in color (bgr,bgg,bgb).
+ *--------------------------------------------------------------------------*/
void wxPLDevDC::ClearBackground( PLINT bgr, PLINT bgg, PLINT bgb,
PLINT x1, PLINT y1, PLINT x2, PLINT y2 )
{
@@ -138,6 +144,11 @@
}
+/*--------------------------------------------------------------------------
+ * void wxPLDevDC::FillPolygon( PLStream *pls )
+ *
+ * Draw a filled polygon.
+ *--------------------------------------------------------------------------*/
void wxPLDevDC::FillPolygon( PLStream *pls )
{
wxPoint *points = new wxPoint[pls->dev_npts];
@@ -153,12 +164,25 @@
delete[] points;
}
+
+/*--------------------------------------------------------------------------
+ * void wxPLDevDC::BlitRectangle( wxPaintDC* dc, int vX, int vY,
+ * int vW, int vH )
+ *
+ * Copy/Blit a rectangle ((vX,vY) to (vX+vW,vY+vH)) into given dc.
+ *--------------------------------------------------------------------------*/
void wxPLDevDC::BlitRectangle( wxPaintDC* dc, int vX, int vY, int vW, int vH )
{
if( m_dc )
dc->Blit( vX, vY, vW, vH, m_dc, vX, vY );
}
+
+/*--------------------------------------------------------------------------
+ * void wxPLDevDC::CreateCanvas( void )
+ *
+ * Create canvas (bitmap and dc) if the driver provides the GUI.
+ *--------------------------------------------------------------------------*/
void wxPLDevDC::CreateCanvas()
{
if( ownGUI ) {
@@ -173,6 +197,12 @@
}
}
+
+/*--------------------------------------------------------------------------
+ * void wxPLDevDC::SetWidth( PLStream *pls )
+ *
+ * Set the width of the drawing pen.
+ *--------------------------------------------------------------------------*/
void wxPLDevDC::SetWidth( PLStream *pls )
{
m_dc->SetPen( *(wxThePenList->FindOrCreatePen(wxColour(pls->cmap0[pls->icol0].r, pls->cmap0[pls->icol0].g,
@@ -181,6 +211,11 @@
}
+/*--------------------------------------------------------------------------
+ * void wxPLDevDC::SetColor0( PLStream *pls )
+ *
+ * Set color from colormap 0.
+ *--------------------------------------------------------------------------*/
void wxPLDevDC::SetColor0( PLStream *pls )
{
m_dc->SetPen( *(wxThePenList->FindOrCreatePen(wxColour(pls->cmap0[pls->icol0].r, pls->cmap0[pls->icol0].g,
@@ -190,6 +225,11 @@
}
+/*--------------------------------------------------------------------------
+ * void wxPLDevDC::SetColor1( PLStream *pls )
+ *
+ * Set color from colormap 1.
+ *--------------------------------------------------------------------------*/
void wxPLDevDC::SetColor1( PLStream *pls )
{
m_dc->SetPen( *(wxThePenList->FindOrCreatePen(wxColour(pls->curcolor.r, pls->curcolor.g,
@@ -199,12 +239,12 @@
}
-/*--------------------------------------------------------------------------*\
- * void wx_set_dc( PLStream* pls, wxDC* dc )
+/*--------------------------------------------------------------------------
+ * void wxPLDevDC::SetExternalBuffer( void* dc )
*
- * Adds a dc to the stream. The associated device is attached to the canvas
- * as the property "dev".
-\*--------------------------------------------------------------------------*/
+ * Adds a dc to the device. In that case, the drivers doesn't provide
+ * a GUI
+ *--------------------------------------------------------------------------*/
void wxPLDevDC::SetExternalBuffer( void* dc )
{
m_dc=(wxDC*)dc; /* Add the dc to the device */
@@ -215,6 +255,11 @@
#ifdef HAVE_FREETYPE
+/*--------------------------------------------------------------------------
+ * void wxPLDevDC::PutPixel( short x, short y, PLINT color )
+ *
+ * Draw a pixel in color color @ (x,y).
+ *--------------------------------------------------------------------------*/
void wxPLDevDC::PutPixel( short x, short y, PLINT color )
{
const wxPen oldpen=m_dc->GetPen();
@@ -226,6 +271,11 @@
}
+/*--------------------------------------------------------------------------
+ * void wxPLDevDC::PutPixel( short x, short y )
+ *
+ * Draw a pixel in current color @ (x,y).
+ *--------------------------------------------------------------------------*/
void wxPLDevDC::PutPixel( short x, short y )
{
m_dc->DrawPoint( x, y );
@@ -233,11 +283,16 @@
}
+/*--------------------------------------------------------------------------
+ * PLINT wxPLDevDC::GetPixel( short x, short y )
+ *
+ * Get color information from pixel @ (x,y).
+ *--------------------------------------------------------------------------*/
PLINT wxPLDevDC::GetPixel( short x, short y )
{
#ifdef __WXGTK__
- // The GetPixel method is incredible slow for wxGTK. Therefore we set the colour
- // always to the background color, since this is the case anyway 99% of the time.
+ /* The GetPixel method is incredible slow for wxGTK. Therefore we set the colour
+ always to the background color, since this is the case anyway 99% of the time. */
PLINT bgr, bgg, bgb; /* red, green, blue */
plgcolbg( &bgr, &bgg, &bgb ); /* get background color information */
return RGB( bgr, bgg, bgb );
@@ -248,9 +303,15 @@
#endif
}
-#endif // HAVE_FREETYPE
+#endif /* HAVE_FREETYPE */
+/*--------------------------------------------------------------------------
+ * void wxPLDevDC::PSDrawTextToDC( char* utf8_string, bool drawText )
+ *
+ * Draw utf8 text to screen if drawText==true. Otherwise determine
+ * width and height of text.
+ *--------------------------------------------------------------------------*/
void wxPLDevDC::PSDrawTextToDC( char* utf8_string, bool drawText )
{
wxCoord w, h, d, l;
@@ -269,6 +330,11 @@
}
+/*--------------------------------------------------------------------------
+ * void wxPLDevDC::PSSetFont( PLUNICODE fci )
+ *
+ * Set font defined by fci.
+ *--------------------------------------------------------------------------*/
void wxPLDevDC::PSSetFont( PLUNICODE fci )
{
unsigned char fontFamily, fontStyle, fontWeight;
@@ -276,8 +342,10 @@
plP_fci2hex( fci, &fontFamily, PL_FCI_FAMILY );
plP_fci2hex( fci, &fontStyle, PL_FCI_STYLE );
plP_fci2hex( fci, &fontWeight, PL_FCI_WEIGHT );
+
if( m_font )
delete m_font;
+
m_font=wxFont::New((int) (fontSize*fontScale), fontFamilyLookup[fontFamily],
fontStyleLookup[fontStyle] & fontWeightLookup[fontWeight] );
m_font->SetUnderlined( underlined );
@@ -285,6 +353,13 @@
}
+/*--------------------------------------------------------------------------
+ * void wxPLDevDC::ProcessString( PLStream* pls, EscText* args )
+ *
+ * This is the main function which processes the unicode text strings.
+ * Font size, rotation and color are set, width and height of the
+ * text string is determined and then the string is drawn to the canvas.
+ *--------------------------------------------------------------------------*/
void wxPLDevDC::ProcessString( PLStream* pls, EscText* args )
{
/* Check that we got unicode, warning message and return if not */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ai...@us...> - 2011-03-03 22:46:20
|
Revision: 11593
http://plplot.svn.sourceforge.net/plplot/?rev=11593&view=rev
Author: airwin
Date: 2011-03-03 22:46:14 +0000 (Thu, 03 Mar 2011)
Log Message:
-----------
Attempt to make the basic mode of the wxwidgets device honor the
-eofill option. With -drvopt backend=0 (basic mode), I have traced
the calls to insure that with -eofill DrawPolygon is called with
wxODDEVEN_RULE, and without the -eofill option, DrawPolygon is called
with wxWINDING_RULE. According to the documentation of DrawPolygon at
http://docs.wxwidgets.org/trunk/classwx_d_c.html#f3ded6183d3ba706d0377e5c25fcaf83
those two separate calls should generate different filled results for
example 27, but there must be a bug in the wxwidgets library because
the results are always the same corresponding to -eofill for -dev
xwin. That is, it appears that wxWINDING_RULE is always ignored for
DrawPolygon, and the default wxODDEVEN_RULE always used instead.
So the current status is the basic mode always handles fills with the
even-odd fill rule regardless of what is specified with -eofill
because of this wxwidgets library bug while the wxGC mode honors the
-eofill rule with the two different kinds of fills.
Modified Paths:
--------------
trunk/drivers/wxwidgets_dc.cpp
Modified: trunk/drivers/wxwidgets_dc.cpp
===================================================================
--- trunk/drivers/wxwidgets_dc.cpp 2011-03-03 21:44:17 UTC (rev 11592)
+++ trunk/drivers/wxwidgets_dc.cpp 2011-03-03 22:46:14 UTC (rev 11593)
@@ -174,7 +174,14 @@
AddtoClipRegion( points[i - 1].x, points[i - 1].y, points[i].x, points[i].y );
}
- m_dc->DrawPolygon( pls->dev_npts, points );
+ if ( pls->dev_eofill )
+ {
+ m_dc->DrawPolygon( pls->dev_npts, points, wxODDEVEN_RULE );
+ }
+ else
+ {
+ m_dc->DrawPolygon( pls->dev_npts, points, wxWINDING_RULE );
+ }
delete[] points;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sm...@us...> - 2009-09-10 14:19:41
|
Revision: 10395
http://plplot.svn.sourceforge.net/plplot/?rev=10395&view=rev
Author: smekal
Date: 2009-09-10 14:19:35 +0000 (Thu, 10 Sep 2009)
Log Message:
-----------
Fixed text positioning bug for superscript/subscript text which occurred if ratio of axis is much higher then 1.
Modified Paths:
--------------
trunk/drivers/wxwidgets_dc.cpp
Modified: trunk/drivers/wxwidgets_dc.cpp
===================================================================
--- trunk/drivers/wxwidgets_dc.cpp 2009-09-08 23:43:42 UTC (rev 10394)
+++ trunk/drivers/wxwidgets_dc.cpp 2009-09-10 14:19:35 UTC (rev 10395)
@@ -317,11 +317,11 @@
wxString str(wxConvUTF8.cMB2WC(utf8_string), *wxConvCurrent);
m_dc->GetTextExtent( str, &w, &h, &d, &l );
if( drawText )
- m_dc->DrawRotatedText( str, (wxCoord) ((posX-yOffset*sin_rot)/scalex),
+ m_dc->DrawRotatedText( str, (wxCoord) (posX/scalex-yOffset/scaley*sin_rot),
(wxCoord) (height-(posY+yOffset*cos_rot)/scaley),
rotation*180.0/M_PI );
posX += (PLINT) (w*scalex*cos_rot);
- posY += (PLINT) (w*scalex*sin_rot);
+ posY += (PLINT) (w*scaley*sin_rot);
textWidth += w;
textHeight = (wxCoord) (textHeight>(h+yOffset/scaley) ? textHeight : (h+yOffset/scaley));
memset( utf8_string, '\0', max_string_length );
@@ -363,7 +363,7 @@
{
/* Check that we got unicode, warning message and return if not */
if( args->unicode_array_len == 0 ) {
- printf( "Non unicode string passed to a cairo driver, ignoring\n" );
+ printf( "Non unicode string passed to the wxWidgets driver, ignoring\n" );
return;
}
@@ -377,7 +377,7 @@
fontSize = pls->chrht * VIRTUAL_PIXELS_PER_MM/scaley * 1.3;
/* calculate rotation of text */
- plRotationShear( args->xform, &rotation, &shear, &stride);
+ plRotationShear( args->xform, &rotation, &shear, &stride );
rotation -= pls->diorot * M_PI / 2.0;
cos_rot = cos( rotation );
sin_rot = sin( rotation );
@@ -391,8 +391,8 @@
posY = args->y;
PSDrawText( args->unicode_array, args->unicode_array_len, false );
- posX = (PLINT) (args->x-(args->just*textWidth)*scalex*cos_rot-(0.5*textHeight)*scalex*sin_rot);
- posY = (PLINT) (args->y-(args->just*textWidth)*scaley*sin_rot+(0.5*textHeight)*scaley*cos_rot);
+ posX = (PLINT) (args->x-((args->just*textWidth)*cos_rot-(0.5*textHeight)*sin_rot)*scalex);
+ posY = (PLINT) (args->y-((args->just*textWidth)*sin_rot+(0.5*textHeight)*cos_rot)*scaley);
PSDrawText( args->unicode_array, args->unicode_array_len, true );
AddtoClipRegion( 0, 0, width, height );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sm...@us...> - 2009-09-11 07:27:37
|
Revision: 10397
http://plplot.svn.sourceforge.net/plplot/?rev=10397&view=rev
Author: smekal
Date: 2009-09-11 07:27:30 +0000 (Fri, 11 Sep 2009)
Log Message:
-----------
I obviously missed some basic math classes back in highschool.
Modified Paths:
--------------
trunk/drivers/wxwidgets_dc.cpp
Modified: trunk/drivers/wxwidgets_dc.cpp
===================================================================
--- trunk/drivers/wxwidgets_dc.cpp 2009-09-11 04:32:14 UTC (rev 10396)
+++ trunk/drivers/wxwidgets_dc.cpp 2009-09-11 07:27:30 UTC (rev 10397)
@@ -391,8 +391,8 @@
posY = args->y;
PSDrawText( args->unicode_array, args->unicode_array_len, false );
- posX = (PLINT) (args->x-((args->just*textWidth)*cos_rot-(0.5*textHeight)*sin_rot)*scalex);
- posY = (PLINT) (args->y-((args->just*textWidth)*sin_rot+(0.5*textHeight)*cos_rot)*scaley);
+ posX = (PLINT) (args->x-((args->just*textWidth)*cos_rot+(0.5*textHeight)*sin_rot)*scalex);
+ posY = (PLINT) (args->y-((args->just*textWidth)*sin_rot-(0.5*textHeight)*cos_rot)*scaley);
PSDrawText( args->unicode_array, args->unicode_array_len, true );
AddtoClipRegion( 0, 0, width, height );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sm...@us...> - 2009-09-16 07:54:11
|
Revision: 10416
http://plplot.svn.sourceforge.net/plplot/?rev=10416&view=rev
Author: smekal
Date: 2009-09-16 07:54:00 +0000 (Wed, 16 Sep 2009)
Log Message:
-----------
Implemented text clipping for wxDC backend.
Modified Paths:
--------------
trunk/drivers/wxwidgets_dc.cpp
Modified: trunk/drivers/wxwidgets_dc.cpp
===================================================================
--- trunk/drivers/wxwidgets_dc.cpp 2009-09-16 06:40:20 UTC (rev 10415)
+++ trunk/drivers/wxwidgets_dc.cpp 2009-09-16 07:54:00 UTC (rev 10416)
@@ -376,6 +376,17 @@
/* Calculate the font size (in pixels) */
fontSize = pls->chrht * VIRTUAL_PIXELS_PER_MM/scaley * 1.3;
+ /* Use PLplot core routine to get the corners of the clipping rectangle */
+ PLINT rcx[4], rcy[4];
+ difilt_clip(rcx, rcy);
+
+ wxPoint cpoints[4];
+ for( int i=0; i<4; i++ ) {
+ cpoints[i].x = rcx[i]/scalex;
+ cpoints[i].y = height-rcy[i]/scaley;
+ }
+ wxDCClipper clip( *m_dc, wxRegion(4, cpoints) );
+
/* calculate rotation of text */
plRotationShear( args->xform, &rotation, &shear, &stride );
rotation -= pls->diorot * M_PI / 2.0;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <and...@us...> - 2012-11-16 21:29:20
|
Revision: 12273
http://plplot.svn.sourceforge.net/plplot/?rev=12273&view=rev
Author: andrewross
Date: 2012-11-16 21:29:14 +0000 (Fri, 16 Nov 2012)
Log Message:
-----------
Add alpha values for wxDC since a few derivatives of this do actually support transparency.
Modified Paths:
--------------
trunk/drivers/wxwidgets_dc.cpp
Modified: trunk/drivers/wxwidgets_dc.cpp
===================================================================
--- trunk/drivers/wxwidgets_dc.cpp 2012-11-16 21:06:29 UTC (rev 12272)
+++ trunk/drivers/wxwidgets_dc.cpp 2012-11-16 21:29:14 UTC (rev 12273)
@@ -239,9 +239,9 @@
//--------------------------------------------------------------------------
void wxPLDevDC::SetColor0( PLStream *pls )
{
- m_dc->SetPen( *( wxThePenList->FindOrCreatePen( wxColour( pls->curcolor.r, pls->curcolor.g, pls->curcolor.b ),
+ m_dc->SetPen( *( wxThePenList->FindOrCreatePen( wxColour( pls->curcolor.r, pls->curcolor.g, pls->curcolor.b, pls->curcolor.a ),
pls->width > 0 ? pls->width : 1, wxSOLID ) ) );
- m_dc->SetBrush( wxBrush( wxColour( pls->curcolor.r, pls->curcolor.g, pls->curcolor.b ) ) );
+ m_dc->SetBrush( wxBrush( wxColour( pls->curcolor.r, pls->curcolor.g, pls->curcolor.b, pls->curcolor.a ) ) );
}
@@ -252,9 +252,9 @@
//--------------------------------------------------------------------------
void wxPLDevDC::SetColor1( PLStream *pls )
{
- m_dc->SetPen( *( wxThePenList->FindOrCreatePen( wxColour( pls->curcolor.r, pls->curcolor.g, pls->curcolor.b ),
+ m_dc->SetPen( *( wxThePenList->FindOrCreatePen( wxColour( pls->curcolor.r, pls->curcolor.g, pls->curcolor.b, pls->curcolor.a ),
pls->width > 0 ? pls->width : 1, wxSOLID ) ) );
- m_dc->SetBrush( wxBrush( wxColour( pls->curcolor.r, pls->curcolor.g, pls->curcolor.b ) ) );
+ m_dc->SetBrush( wxBrush( wxColour( pls->curcolor.r, pls->curcolor.g, pls->curcolor.b, pls->curcolor.a ) ) );
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ai...@us...> - 2013-08-09 16:21:54
|
Revision: 12475
http://sourceforge.net/p/plplot/code/12475
Author: airwin
Date: 2013-08-09 16:21:45 +0000 (Fri, 09 Aug 2013)
Log Message:
-----------
Use correct API for DrawPolygon. Thanks to Joost Kuckartz for
spotting this error, and he reports this fix solves an offset issue he
had with wxwidgets plots.
Modified Paths:
--------------
trunk/drivers/wxwidgets_dc.cpp
Modified: trunk/drivers/wxwidgets_dc.cpp
===================================================================
--- trunk/drivers/wxwidgets_dc.cpp 2013-08-04 18:13:16 UTC (rev 12474)
+++ trunk/drivers/wxwidgets_dc.cpp 2013-08-09 16:21:45 UTC (rev 12475)
@@ -165,6 +165,8 @@
void wxPLDevDC::FillPolygon( PLStream *pls )
{
wxPoint *points = new wxPoint[pls->dev_npts];
+ wxCoord xoffset = 0;
+ wxCoord yoffset = 0;
for ( int i = 0; i < pls->dev_npts; i++ )
{
@@ -176,11 +178,11 @@
if ( pls->dev_eofill )
{
- m_dc->DrawPolygon( pls->dev_npts, points, wxODDEVEN_RULE );
+ m_dc->DrawPolygon( pls->dev_npts, points, xoffset, yoffset, wxODDEVEN_RULE );
}
else
{
- m_dc->DrawPolygon( pls->dev_npts, points, wxWINDING_RULE );
+ m_dc->DrawPolygon( pls->dev_npts, points, xoffset, yoffset, wxWINDING_RULE );
}
delete[] points;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|