From: <ai...@us...> - 2013-01-30 08:05:48
|
Revision: 12289 http://plplot.svn.sourceforge.net/plplot/?rev=12289&view=rev Author: airwin Date: 2013-01-30 08:05:39 +0000 (Wed, 30 Jan 2013) Log Message: ----------- Move to floating point pen width for qt devices. This appears to work now since calling plwidth(0.01); in example 1 yields extremely thin line results for a number of different qt devices. During the course of the testing I found a qt device driver issue which is the -width option (even -width 100.) appears to have no effect on line width except to make it fixed at unity. I could not figure out the cause of this issue. (Which is why I did my testing by calling plwidth explicitly from example 1). Modified Paths: -------------- trunk/bindings/qt_gui/plqt.cpp trunk/drivers/qt.cpp trunk/include/qt.h Modified: trunk/bindings/qt_gui/plqt.cpp =================================================================== --- trunk/bindings/qt_gui/plqt.cpp 2013-01-30 04:40:35 UTC (rev 12288) +++ trunk/bindings/qt_gui/plqt.cpp 2013-01-30 08:05:39 UTC (rev 12289) @@ -452,13 +452,13 @@ m_painterP->setBrush( linear_gradient ); } -void QtPLDriver::setWidth( PLINT w ) +void QtPLDriver::setWidthF( PLFLT w ) { if ( !m_painterP->isActive() ) return; QPen p = m_painterP->pen(); - p.setWidth( w ); + p.setWidthF( w ); m_painterP->setPen( p ); } @@ -928,11 +928,11 @@ redrawFromLastFlush = true; } -void QtPLWidget::setWidth( PLINT w ) +void QtPLWidget::setWidthF( PLFLT w ) { BufferElement el; el.Element = SET_WIDTH; - el.Data.intParam = w; + el.Data.fltParam = w; m_listBuffer.append( el ); // redrawFromLastFlush=true; } @@ -1412,7 +1412,7 @@ break; case SET_WIDTH: - SolidPen.setWidthF( i->Data.intParam ); + SolidPen.setWidthF( i->Data.fltParam ); if ( hasPen ) { p->setPen( SolidPen ); Modified: trunk/drivers/qt.cpp =================================================================== --- trunk/drivers/qt.cpp 2013-01-30 04:40:35 UTC (rev 12288) +++ trunk/drivers/qt.cpp 2013-01-30 08:05:39 UTC (rev 12289) @@ -450,7 +450,7 @@ switch ( op ) { case PLSTATE_WIDTH: - widget->setWidth( pls->width ); + widget->setWidthF( pls->width ); break; case PLSTATE_COLOR0: @@ -893,7 +893,7 @@ switch ( op ) { case PLSTATE_WIDTH: - widget->setWidth( pls->width ); + widget->setWidthF( pls->width ); break; case PLSTATE_COLOR0: @@ -1186,7 +1186,7 @@ switch ( op ) { case PLSTATE_WIDTH: - widget->setWidth( pls->width ); + widget->setWidthF( pls->width ); break; case PLSTATE_COLOR0: @@ -1446,7 +1446,7 @@ switch ( op ) { case PLSTATE_WIDTH: - widget->setWidth( pls->width ); + widget->setWidthF( pls->width ); break; case PLSTATE_COLOR0: @@ -1648,7 +1648,7 @@ switch ( op ) { case PLSTATE_WIDTH: - widget->setWidth( pls->width ); + widget->setWidthF( pls->width ); break; case PLSTATE_COLOR0: Modified: trunk/include/qt.h =================================================================== --- trunk/include/qt.h 2013-01-30 04:40:35 UTC (rev 12288) +++ trunk/include/qt.h 2013-01-30 08:05:39 UTC (rev 12289) @@ -135,7 +135,7 @@ virtual void setGradient( int x1, int x2, int y1, int y2, unsigned char *r, unsigned char *g, unsigned char *b, PLFLT *alpha, PLINT ncol1 ); - virtual void setWidth( PLINT w ); + virtual void setWidthF( PLFLT w ); // Set pen to draw solid strokes (called after drawing dashed strokes) virtual void setSolid(); // Conversion factor from internal plplot coordinates to device coordinates @@ -328,7 +328,7 @@ void setGradient( int x1, int x2, int y1, int y2, unsigned char *r, unsigned char *g, unsigned char *b, PLFLT *alpha, PLINT ncol1 ); - void setWidth( PLINT r ); + void setWidthF( PLFLT r ); void drawText( EscText* txt ); void flush(); void getCursorCmd( PLGraphicsIn *ptr ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |