Skip to content

Commit 48c007e

Browse files
committedAug 30, 2011
[FEATURE]: offset for line pattern symbols
1 parent 339d800 commit 48c007e

File tree

11 files changed

+131
-77
lines changed

11 files changed

+131
-77
lines changed
 

‎python/core/qgscomposeritem.sip

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,7 @@ class QgsComposerItem: QObject, QGraphicsRectItem
326326
bool imageSizeConsideringRotation( double& width, double& height ) const;
327327
/**Calculates corner point after rotation and scaling*/
328328
bool cornerPointOnRotatedAndScaledRect( double& x, double& y, double width, double height ) const;
329-
/**Returns a point on the line from startPoint to directionPoint that is a certain distance away from the starting point*/
330-
QPointF pointOnLineWithDistance( const QPointF& startPoint, const QPointF& directionPoint, double distance ) const;
329+
331330
/**Calculates width / height of the bounding box of a rotated rectangle (mRotation)*/
332331
void sizeChangedByRotation(double& width, double& height);
333332
/**Rotates a point / vector

‎src/core/composer/qgscomposeritem.cpp

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include "qgsapplication.h"
3131
#include "qgsrectangle.h" //just for debugging
3232
#include "qgslogger.h"
33+
#include "qgssymbollayerv2utils.h" //for pointOnLineWithDistance
3334

3435
#include <cmath>
3536

@@ -954,7 +955,7 @@ bool QgsComposerItem::imageSizeConsideringRotation( double& width, double& heigh
954955

955956
//assume points 1 and 3 are on the rectangle boundaries. Calculate 2 and 4.
956957
double distM1 = sqrt(( x1 - midX ) * ( x1 - midX ) + ( y1 - midY ) * ( y1 - midY ) );
957-
QPointF p2 = pointOnLineWithDistance( QPointF( midX, midY ), QPointF( x2, y2 ), distM1 );
958+
QPointF p2 = QgsSymbolLayerV2Utils::pointOnLineWithDistance( QPointF( midX, midY ), QPointF( x2, y2 ), distM1 );
958959

959960
if ( p2.x() < width && p2.x() > 0 && p2.y() < height && p2.y() > 0 )
960961
{
@@ -965,8 +966,8 @@ bool QgsComposerItem::imageSizeConsideringRotation( double& width, double& heigh
965966

966967
//else assume that points 2 and 4 are on the rectangle boundaries. Calculate 1 and 3
967968
double distM2 = sqrt(( x2 - midX ) * ( x2 - midX ) + ( y2 - midY ) * ( y2 - midY ) );
968-
QPointF p1 = pointOnLineWithDistance( QPointF( midX, midY ), QPointF( x1, y1 ), distM2 );
969-
QPointF p3 = pointOnLineWithDistance( QPointF( midX, midY ), QPointF( x3, y3 ), distM2 );
969+
QPointF p1 = QgsSymbolLayerV2Utils::pointOnLineWithDistance( QPointF( midX, midY ), QPointF( x1, y1 ), distM2 );
970+
QPointF p3 = QgsSymbolLayerV2Utils::pointOnLineWithDistance( QPointF( midX, midY ), QPointF( x3, y3 ), distM2 );
970971
width = sqrt(( x2 - p1.x() ) * ( x2 - p1.x() ) + ( y2 - p1.y() ) * ( y2 - p1.y() ) );
971972
height = sqrt(( p3.x() - x2 ) * ( p3.x() - x2 ) + ( p3.y() - y2 ) * ( p3.y() - y2 ) );
972973
return true;
@@ -1036,15 +1037,6 @@ bool QgsComposerItem::cornerPointOnRotatedAndScaledRect( double& x, double& y, d
10361037
return false;
10371038
}
10381039

1039-
QPointF QgsComposerItem::pointOnLineWithDistance( const QPointF& startPoint, const QPointF& directionPoint, double distance ) const
1040-
{
1041-
double dx = directionPoint.x() - startPoint.x();
1042-
double dy = directionPoint.y() - startPoint.y();
1043-
double length = sqrt( dx * dx + dy * dy );
1044-
double scaleFactor = distance / length;
1045-
return QPointF( startPoint.x() + dx * scaleFactor, startPoint.y() + dy * scaleFactor );
1046-
}
1047-
10481040
void QgsComposerItem::sizeChangedByRotation( double& width, double& height )
10491041
{
10501042
if ( mRotation == 0.0 )

‎src/core/composer/qgscomposeritem.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,7 @@ class CORE_EXPORT QgsComposerItem: public QObject, public QGraphicsRectItem
315315
bool imageSizeConsideringRotation( double& width, double& height ) const;
316316
/**Calculates corner point after rotation and scaling*/
317317
bool cornerPointOnRotatedAndScaledRect( double& x, double& y, double width, double height ) const;
318-
/**Returns a point on the line from startPoint to directionPoint that is a certain distance away from the starting point*/
319-
QPointF pointOnLineWithDistance( const QPointF& startPoint, const QPointF& directionPoint, double distance ) const;
318+
320319
/**Calculates width / height of the bounding box of a rotated rectangle (mRotation)*/
321320
void sizeChangedByRotation( double& width, double& height );
322321
/**Rotates a point / vector

‎src/core/composer/qgscomposermap.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
#include "qgslabel.h"
3333
#include "qgslabelattributes.h"
34+
#include "qgssymbollayerv2utils.h" //for pointOnLineWithDistance
3435

3536
#include <QGraphicsScene>
3637
#include <QGraphicsView>
@@ -881,7 +882,7 @@ void QgsComposerMap::drawGrid( QPainter* p )
881882
for ( ; vIt != verticalLines.constEnd(); ++vIt )
882883
{
883884
//start mark
884-
crossEnd1 = pointOnLineWithDistance( vIt->second.p1(), vIt->second.p2(), mCrossLength );
885+
crossEnd1 = QgsSymbolLayerV2Utils::pointOnLineWithDistance( vIt->second.p1(), vIt->second.p2(), mCrossLength );
885886
p->drawLine( vIt->second.p1(), crossEnd1 );
886887

887888
//test for intersection with every horizontal line
@@ -890,35 +891,35 @@ void QgsComposerMap::drawGrid( QPainter* p )
890891
{
891892
if ( hIt->second.intersect( vIt->second, &intersectionPoint ) == QLineF::BoundedIntersection )
892893
{
893-
crossEnd1 = pointOnLineWithDistance( intersectionPoint, vIt->second.p1(), mCrossLength );
894-
crossEnd2 = pointOnLineWithDistance( intersectionPoint, vIt->second.p2(), mCrossLength );
894+
crossEnd1 = QgsSymbolLayerV2Utils::pointOnLineWithDistance( intersectionPoint, vIt->second.p1(), mCrossLength );
895+
crossEnd2 = QgsSymbolLayerV2Utils::pointOnLineWithDistance( intersectionPoint, vIt->second.p2(), mCrossLength );
895896
p->drawLine( crossEnd1, crossEnd2 );
896897
}
897898
}
898899
//end mark
899-
QPointF crossEnd2 = pointOnLineWithDistance( vIt->second.p2(), vIt->second.p1(), mCrossLength );
900+
QPointF crossEnd2 = QgsSymbolLayerV2Utils::pointOnLineWithDistance( vIt->second.p2(), vIt->second.p1(), mCrossLength );
900901
p->drawLine( vIt->second.p2(), crossEnd2 );
901902
}
902903

903904
hIt = horizontalLines.constBegin();
904905
for ( ; hIt != horizontalLines.constEnd(); ++hIt )
905906
{
906907
//start mark
907-
crossEnd1 = pointOnLineWithDistance( hIt->second.p1(), hIt->second.p2(), mCrossLength );
908+
crossEnd1 = QgsSymbolLayerV2Utils::pointOnLineWithDistance( hIt->second.p1(), hIt->second.p2(), mCrossLength );
908909
p->drawLine( hIt->second.p1(), crossEnd1 );
909910

910911
vIt = verticalLines.constBegin();
911912
for ( ; vIt != verticalLines.constEnd(); ++vIt )
912913
{
913914
if ( vIt->second.intersect( hIt->second, &intersectionPoint ) == QLineF::BoundedIntersection )
914915
{
915-
crossEnd1 = pointOnLineWithDistance( intersectionPoint, hIt->second.p1(), mCrossLength );
916-
crossEnd2 = pointOnLineWithDistance( intersectionPoint, hIt->second.p2(), mCrossLength );
916+
crossEnd1 = QgsSymbolLayerV2Utils::pointOnLineWithDistance( intersectionPoint, hIt->second.p1(), mCrossLength );
917+
crossEnd2 = QgsSymbolLayerV2Utils::pointOnLineWithDistance( intersectionPoint, hIt->second.p2(), mCrossLength );
917918
p->drawLine( crossEnd1, crossEnd2 );
918919
}
919920
}
920921
//end mark
921-
crossEnd1 = pointOnLineWithDistance( hIt->second.p2(), hIt->second.p1(), mCrossLength );
922+
crossEnd1 = QgsSymbolLayerV2Utils::pointOnLineWithDistance( hIt->second.p2(), hIt->second.p1(), mCrossLength );
922923
p->drawLine( hIt->second.p2(), crossEnd1 );
923924
}
924925

‎src/core/symbology-ng/qgsfillsymbollayerv2.cpp

Lines changed: 63 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,7 @@ QgsSymbolLayerV2* QgsLinePatternFillSymbolLayer::create( const QgsStringMap& pro
386386
double distance = 5;
387387
double lineWidth = 0.5;
388388
QColor color( Qt::black );
389+
double offset = 0.0;
389390

390391
if ( properties.contains( "lineangle" ) )
391392
{
@@ -410,6 +411,12 @@ QgsSymbolLayerV2* QgsLinePatternFillSymbolLayer::create( const QgsStringMap& pro
410411
color = QgsSymbolLayerV2Utils::decodeColor( properties["color"] );
411412
}
412413
patternLayer->setColor( color );
414+
415+
if ( properties.contains( "offset" ) )
416+
{
417+
offset = properties["offset"].toDouble();
418+
}
419+
patternLayer->setOffset( offset );
413420
return patternLayer;
414421
}
415422

@@ -434,75 +441,89 @@ void QgsLinePatternFillSymbolLayer::startRender( QgsSymbolV2RenderContext& conte
434441
}
435442

436443
double outlinePixelWidth = context.outputPixelSize( mLineWidth );
444+
double outputPixelDist = context.outputPixelSize( mDistance );
445+
double outputPixelOffset = context.outputPixelSize( mOffset );
437446

438-
//find a suitable multiple of width and heigh
447+
//depending on the angle, we might need to render into a larger image and use a subset of it
448+
int dx = 0;
449+
int dy = 0;
439450

440-
QImage patternImage( qAbs( width ), height, QImage::Format_ARGB32 );
451+
QImage patternImage( width, height, QImage::Format_ARGB32 );
441452
patternImage.fill( 0 );
442453
QPainter p( &patternImage );
454+
443455
p.setRenderHint( QPainter::Antialiasing, true );
444456
QPen pen( mColor );
445457
pen.setWidthF( outlinePixelWidth );
446458
pen.setCapStyle( Qt::FlatCap );
447459
p.setPen( pen );
448460

449-
//draw line and dots in the border
461+
QPoint p1, p2, p3, p4, p5, p6;
450462
if ( doubleNear( mLineAngle, 0.0 ) || doubleNear( mLineAngle, 360.0 ) || doubleNear( mLineAngle, 180.0 ) )
451463
{
452-
p.drawLine( QPointF( 0, height / 2.0 ), QPointF( width, height / 2.0 ) );
464+
p1 = QPoint( 0, height );
465+
p2 = QPoint( width, height );
466+
p3 = QPoint( 0, 0 );
467+
p4 = QPoint( width, 0 );
468+
p5 = QPoint( 0, 2 * height );
469+
p6 = QPoint( width, 2 * height );
453470
}
454471
else if ( doubleNear( mLineAngle, 90.0 ) || doubleNear( mLineAngle, 270.0 ) )
455472
{
456-
p.drawLine( QPointF( width / 2.0, 0 ), QPointF( width / 2.0, height ) );
473+
p1 = QPoint( 0, height );
474+
p2 = QPoint( 0, 0 );
475+
p3 = QPoint( width, height );
476+
p4 = QPoint( width, 0 );
477+
p5 = QPoint( -width, height );
478+
p6 = QPoint( -width, 0 );
457479
}
458480
else if (( mLineAngle > 0 && mLineAngle < 90 ) || ( mLineAngle > 180 && mLineAngle < 270 ) )
459481
{
460-
p.drawLine( QPointF( 0, height ), QPointF( width, 0 ) );
482+
dx = outputPixelDist * cos(( 90 - mLineAngle ) * M_PI / 180 );
483+
dy = outputPixelDist * sin(( 90 - mLineAngle ) * M_PI / 180 );
484+
p1 = QPoint( 0, height );
485+
p2 = QPoint( width, 0 );
486+
p3 = QPoint( -dx, height - dy );
487+
p4 = QPoint( width - dx, -dy );
488+
p5 = QPoint( dx, height + dy );
489+
p6 = QPoint( width + dx, dy );
461490
}
462491
else if (( mLineAngle < 180 ) || ( mLineAngle > 270 && mLineAngle < 360 ) )
463492
{
464-
p.drawLine( QPointF( width, height ), QPointF( 0, 0 ) );
493+
dy = outputPixelDist * cos(( 180 - mLineAngle ) * M_PI / 180 );
494+
dx = outputPixelDist * sin(( 180 - mLineAngle ) * M_PI / 180 );
495+
p1 = QPoint( width, height );
496+
p2 = QPoint( 0, 0 );
497+
p5 = QPoint( width + dx, height - dy );
498+
p6 = QPoint( dx, -dy );
499+
p3 = QPoint( width - dx, height + dy );
500+
p4 = QPoint( -dx, dy );
465501
}
466502

467-
//todo: calculate triangles more accurately
468-
double d1 = 0;
469-
double d2 = 0;
470-
QPolygonF triangle1, triangle2;
471-
if ( mLineAngle > 0 && mLineAngle < 90 )
472-
{
473-
d1 = ( outlinePixelWidth / 2.0 ) / cos( mLineAngle * M_PI / 180 );
474-
d2 = ( outlinePixelWidth / 2.0 ) / cos(( 90 - mLineAngle ) * M_PI / 180 );
475-
triangle1 << QPointF( 0, 0 ) << QPointF( 0, d1 ) << QPointF( d2, 0 ) << QPointF( 0, 0 );
476-
triangle2 << QPointF( width, height ) << QPointF( width - d2, height ) << QPointF( width, height - d1 ) << QPointF( width, height );
477-
}
478-
else if ( mLineAngle > 90 && mLineAngle < 180 )
503+
if ( !doubleNear( mOffset, 0.0 ) ) //shift everything
479504
{
480-
d1 = ( outlinePixelWidth / 2.0 ) / cos(( mLineAngle - 90 ) * M_PI / 180 );
481-
d2 = ( outlinePixelWidth / 2.0 ) / cos(( 180 - mLineAngle ) * M_PI / 180 );
482-
triangle1 << QPointF( width, 0 ) << QPointF( width - d1, 0 ) << QPointF( width, d2 ) << QPointF( width, 0 );
483-
triangle2 << QPointF( 0, height ) << QPointF( 0, height - d2 ) << QPointF( d1, height ) << QPointF( 0, height );
484-
}
485-
else if ( mLineAngle > 180 && mLineAngle < 270 )
486-
{
487-
d1 = ( outlinePixelWidth / 2.0 ) / cos(( mLineAngle - 180 ) * M_PI / 180 );
488-
d2 = ( outlinePixelWidth / 2.0 ) / cos(( 270 - mLineAngle ) * M_PI / 180 );
489-
triangle1 << QPointF( 0, 0 ) << QPointF( 0, d1 ) << QPointF( d2, 0 ) << QPointF( 0, 0 );
490-
triangle2 << QPointF( width, height ) << QPointF( width - d2, height ) << QPointF( width, height - d1 ) << QPointF( width, height );
491-
}
492-
else if ( mLineAngle > 270 && mLineAngle < 360 )
493-
{
494-
d1 = ( outlinePixelWidth / 2.0 ) / cos(( mLineAngle - 270 ) * M_PI / 180 );
495-
d2 = ( outlinePixelWidth / 2.0 ) / cos(( 360 - mLineAngle ) * M_PI / 180 );
496-
triangle1 << QPointF( width, 0 ) << QPointF( width - d1, 0 ) << QPointF( width, d2 ) << QPointF( width, 0 );
497-
triangle2 << QPointF( 0, height ) << QPointF( 0, height - d2 ) << QPointF( d1, height ) << QPointF( 0, height );
505+
QPointF p3Shift = QgsSymbolLayerV2Utils::pointOnLineWithDistance( p1, p3, outputPixelDist + outputPixelOffset );
506+
p3 = QPoint( p3Shift.x(), p3Shift.y() );
507+
QPointF p4Shift = QgsSymbolLayerV2Utils::pointOnLineWithDistance( p2, p4, outputPixelDist + outputPixelOffset );
508+
p4 = QPoint( p4Shift.x(), p4Shift.y() );
509+
QPointF p5Shift = QgsSymbolLayerV2Utils::pointOnLineWithDistance( p1, p5, outputPixelDist - outputPixelOffset );
510+
p5 = QPoint( p5Shift.x(), p5Shift.y() );
511+
QPointF p6Shift = QgsSymbolLayerV2Utils::pointOnLineWithDistance( p2, p6, outputPixelDist - outputPixelOffset );
512+
p6 = QPoint( p6Shift.x(), p6Shift.y() );
513+
514+
//update p1, p2 last
515+
p1 = QgsSymbolLayerV2Utils::pointOnLineWithDistance( p1, p3, outputPixelOffset ).toPoint();
516+
p2 = QgsSymbolLayerV2Utils::pointOnLineWithDistance( p2, p4, outputPixelOffset ).toPoint();
498517
}
499518

500-
p.setPen( QPen( Qt::NoPen ) );
501-
p.setBrush( QBrush( mColor ) );
502-
p.drawPolygon( triangle1 );
503-
p.drawPolygon( triangle2 );
519+
p.drawLine( p1, p2 );
520+
p.drawLine( p3, p4 );
521+
p.drawLine( p5, p6 );
504522
p.end();
505523

524+
//debug
525+
//patternImage.save( "/home/marco/tmp/patternImage.png", "png" );
526+
506527
//set image to mBrush
507528
if ( !doubleNear( context.alpha(), 1.0 ) )
508529
{
@@ -536,6 +557,7 @@ QgsStringMap QgsLinePatternFillSymbolLayer::properties() const
536557
map.insert( "distance", QString::number( mDistance ) );
537558
map.insert( "linewidth", QString::number( mLineWidth ) );
538559
map.insert( "color", QgsSymbolLayerV2Utils::encodeColor( mColor ) );
560+
map.insert( "offset", QString::number( mOffset ) );
539561
return map;
540562
}
541563

‎src/core/symbology-ng/qgsfillsymbollayerv2.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ class CORE_EXPORT QgsLinePatternFillSymbolLayer: public QgsImageFillSymbolLayer
157157
double lineWidth() const { return mLineWidth; }
158158
void setColor( const QColor& c ) { mColor = c; }
159159
QColor color() const { return mColor; }
160+
void setOffset( double offset ) { mOffset = offset; }
161+
double offset() const { return mOffset; }
160162

161163
protected:
162164
/**Distance (in mm or map units) between lines*/
@@ -166,6 +168,8 @@ class CORE_EXPORT QgsLinePatternFillSymbolLayer: public QgsImageFillSymbolLayer
166168
QColor mColor;
167169
/**Vector line angle in degrees (0 = horizontal, counterclockwise)*/
168170
double mLineAngle;
171+
/**Offset perpendicular to line direction*/
172+
double mOffset;
169173
};
170174

171175
class CORE_EXPORT QgsPointPatternFillSymbolLayer: public QgsImageFillSymbolLayer

‎src/core/symbology-ng/qgssymbollayerv2utils.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -765,3 +765,12 @@ void QgsSymbolLayerV2Utils::multiplyImageOpacity( QImage* image, qreal alpha )
765765
}
766766
}
767767
}
768+
769+
QPointF QgsSymbolLayerV2Utils::pointOnLineWithDistance( const QPointF& startPoint, const QPointF& directionPoint, double distance )
770+
{
771+
double dx = directionPoint.x() - startPoint.x();
772+
double dy = directionPoint.y() - startPoint.y();
773+
double length = sqrt( dx * dx + dy * dy );
774+
double scaleFactor = distance / length;
775+
return QPointF( startPoint.x() + dx * scaleFactor, startPoint.y() + dy * scaleFactor );
776+
}

‎src/core/symbology-ng/qgssymbollayerv2utils.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ class CORE_EXPORT QgsSymbolLayerV2Utils
8181

8282
/**Multiplies opacity of image pixel values with a (global) transparency value*/
8383
static void multiplyImageOpacity( QImage* image, qreal alpha );
84+
85+
/**Returns a point on the line from startPoint to directionPoint that is a certain distance away from the starting point*/
86+
static QPointF pointOnLineWithDistance( const QPointF& startPoint, const QPointF& directionPoint, double distance );
8487
};
8588

8689
class QPolygonF;

‎src/gui/symbology-ng/qgssymbollayerv2widget.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -930,6 +930,7 @@ void QgsLinePatternFillSymbolLayerWidget::setSymbolLayer( QgsSymbolLayerV2* laye
930930
mAngleSpinBox->setValue( mLayer->lineAngle() );
931931
mDistanceSpinBox->setValue( mLayer->distance() );
932932
mLineWidthSpinBox->setValue( mLayer->lineWidth() );
933+
mOffsetSpinBox->setValue( mLayer->offset() );
933934
}
934935
}
935936

@@ -965,6 +966,15 @@ void QgsLinePatternFillSymbolLayerWidget::on_mLineWidthSpinBox_valueChanged( dou
965966
}
966967
}
967968

969+
void QgsLinePatternFillSymbolLayerWidget::on_mOffsetSpinBox_valueChanged( double d )
970+
{
971+
if ( mLayer )
972+
{
973+
mLayer->setOffset( d );
974+
emit changed();
975+
}
976+
}
977+
968978
void QgsLinePatternFillSymbolLayerWidget::on_mColorPushButton_clicked()
969979
{
970980
if ( mLayer )

‎src/gui/symbology-ng/qgssymbollayerv2widget.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -269,14 +269,14 @@ class QgsLinePatternFillSymbolLayer;
269269

270270
class GUI_EXPORT QgsLinePatternFillSymbolLayerWidget : public QgsSymbolLayerV2Widget, private Ui::WidgetLinePatternFill
271271
{
272-
Q_OBJECT
272+
Q_OBJECT
273273

274274
public:
275275

276276
QgsLinePatternFillSymbolLayerWidget( const QgsVectorLayer* vl, QWidget* parent = NULL );
277277
static QgsSymbolLayerV2Widget* create( const QgsVectorLayer* vl ) { return new QgsLinePatternFillSymbolLayerWidget( vl ); }
278278

279-
virtual void setSymbolLayer( QgsSymbolLayerV2* layer);
279+
virtual void setSymbolLayer( QgsSymbolLayerV2* layer );
280280
virtual QgsSymbolLayerV2* symbolLayer();
281281

282282
protected:
@@ -286,6 +286,7 @@ class GUI_EXPORT QgsLinePatternFillSymbolLayerWidget : public QgsSymbolLayerV2Wi
286286
void on_mAngleSpinBox_valueChanged( double d );
287287
void on_mDistanceSpinBox_valueChanged( double d );
288288
void on_mLineWidthSpinBox_valueChanged( double d );
289+
void on_mOffsetSpinBox_valueChanged( double d );
289290
void on_mColorPushButton_clicked();
290291
void on_mOutlinePushButton_clicked();
291292
};
@@ -298,24 +299,24 @@ class QgsPointPatternFillSymbolLayer;
298299

299300
class GUI_EXPORT QgsPointPatternFillSymbolLayerWidget: public QgsSymbolLayerV2Widget, private Ui::WidgetPointPatternFill
300301
{
301-
Q_OBJECT
302+
Q_OBJECT
302303

303304
public:
304305
QgsPointPatternFillSymbolLayerWidget( const QgsVectorLayer* vl, QWidget* parent = NULL );
305306
static QgsSymbolLayerV2Widget* create( const QgsVectorLayer* vl ) { return new QgsPointPatternFillSymbolLayerWidget( vl ); }
306307

307-
virtual void setSymbolLayer( QgsSymbolLayerV2* layer);
308+
virtual void setSymbolLayer( QgsSymbolLayerV2* layer );
308309
virtual QgsSymbolLayerV2* symbolLayer();
309310

310311
protected:
311312
QgsPointPatternFillSymbolLayer* mLayer;
312313
void updateMarkerIcon();
313314

314315
private slots:
315-
void on_mHorizontalDistanceSpinBox_valueChanged ( double d );
316-
void on_mVerticalDistanceSpinBox_valueChanged ( double d );
317-
void on_mHorizontalDisplacementSpinBox_valueChanged ( double d );
318-
void on_mVerticalDisplacementSpinBox_valueChanged ( double d );
316+
void on_mHorizontalDistanceSpinBox_valueChanged( double d );
317+
void on_mVerticalDistanceSpinBox_valueChanged( double d );
318+
void on_mHorizontalDisplacementSpinBox_valueChanged( double d );
319+
void on_mVerticalDisplacementSpinBox_valueChanged( double d );
319320
void on_mChangeMarkerButton_clicked();
320321
};
321322

‎src/ui/symbollayer/widget_linepatternfill.ui

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,34 +56,48 @@
5656
</property>
5757
</widget>
5858
</item>
59-
<item row="3" column="0">
59+
<item row="4" column="0">
6060
<widget class="QLabel" name="mColorLabel">
6161
<property name="text">
6262
<string>Color</string>
6363
</property>
6464
</widget>
6565
</item>
66-
<item row="3" column="1">
66+
<item row="4" column="1">
6767
<widget class="QPushButton" name="mColorPushButton">
6868
<property name="text">
6969
<string>Change</string>
7070
</property>
7171
</widget>
7272
</item>
73-
<item row="4" column="0">
73+
<item row="5" column="0">
7474
<widget class="QLabel" name="mOutlineLabel">
7575
<property name="text">
7676
<string>Outline</string>
7777
</property>
7878
</widget>
7979
</item>
80-
<item row="4" column="1">
80+
<item row="5" column="1">
8181
<widget class="QPushButton" name="mOutlinePushButton">
8282
<property name="text">
8383
<string>Change</string>
8484
</property>
8585
</widget>
8686
</item>
87+
<item row="3" column="0">
88+
<widget class="QLabel" name="mOffsetLabel">
89+
<property name="text">
90+
<string>Offset</string>
91+
</property>
92+
</widget>
93+
</item>
94+
<item row="3" column="1">
95+
<widget class="QDoubleSpinBox" name="mOffsetSpinBox">
96+
<property name="minimum">
97+
<double>-99.000000000000000</double>
98+
</property>
99+
</widget>
100+
</item>
87101
</layout>
88102
</widget>
89103
<resources/>

0 commit comments

Comments
 (0)
Please sign in to comment.