Skip to content
Permalink
Browse files

fix offset side for polygons

  • Loading branch information
3nids committed Feb 13, 2018
1 parent 5d7eb19 commit 77f864b82ff22db83c52f6c95332174206493c78
Showing with 11 additions and 10 deletions.
  1. +10 −9 src/app/qgsmaptooloffsetcurve.cpp
  2. +1 −1 src/app/qgsmaptooloffsetcurve.h
@@ -200,7 +200,7 @@ void QgsMapToolOffsetCurve::applyOffset( const double &offset, const Qt::Keyboar
mLayer->beginEditCommand( tr( "Offset curve" ) );

bool editOk;
if ( !mCtrlHeldOnFirstClick && !modifiers.testFlag( Qt::ControlModifier ) )
if ( !mCtrlHeldOnFirstClick && !( modifiers & Qt::ControlModifier ) )
{
editOk = mLayer->changeGeometry( mModifiedFeature, mModifiedGeometry );
}
@@ -240,7 +240,6 @@ void QgsMapToolOffsetCurve::cancel()
{
deleteUserInputWidget();
deleteRubberBandAndGeometry();
mCtrlHeldOnFirstClick = false;
mLayer = nullptr;
}

@@ -413,7 +412,7 @@ void QgsMapToolOffsetCurve::updateGeometryAndRubberBand( double offset )
}
else
{
offsetGeom = mManipulatedGeometry.buffer( offset, quadSegments, capStyle, joinStyle, miterLimit );
offsetGeom = mManipulatedGeometry.buffer( -offset, quadSegments, capStyle, joinStyle, miterLimit );
}

if ( !offsetGeom )
@@ -440,13 +439,15 @@ QgsOffsetUserWidget::QgsOffsetUserWidget( QWidget *parent )
{
setupUi( this );

mOffsetSpinBox->setDecimals( 6 );

// fill comboboxes
mJoinStyleComboBox->addItem( tr( "round" ), QgsGeometry::JoinStyleRound );
mJoinStyleComboBox->addItem( tr( "miter" ), QgsGeometry::JoinStyleMiter );
mJoinStyleComboBox->addItem( tr( "bevel" ), QgsGeometry::JoinStyleBevel );
mCapStyleComboBox->addItem( tr( "round" ), QgsGeometry::CapRound );
mCapStyleComboBox->addItem( tr( "flat" ), QgsGeometry::CapFlat );
mCapStyleComboBox->addItem( tr( "square" ), QgsGeometry::CapSquare );
mJoinStyleComboBox->addItem( tr( "Round" ), QgsGeometry::JoinStyleRound );
mJoinStyleComboBox->addItem( tr( "Miter" ), QgsGeometry::JoinStyleMiter );
mJoinStyleComboBox->addItem( tr( "Bevel" ), QgsGeometry::JoinStyleBevel );
mCapStyleComboBox->addItem( tr( "Round" ), QgsGeometry::CapRound );
mCapStyleComboBox->addItem( tr( "Flat" ), QgsGeometry::CapFlat );
mCapStyleComboBox->addItem( tr( "Square" ), QgsGeometry::CapSquare );

QgsSettings s;
QgsGeometry::JoinStyle joinStyle = static_cast< QgsGeometry::JoinStyle >( s.value( QStringLiteral( "/qgis/digitizing/offset_join_style" ), QgsGeometry::JoinStyleRound ).toInt() );
@@ -77,7 +77,7 @@ class APP_EXPORT QgsMapToolOffsetCurve: public QgsMapToolEdit
//! Snapping indicators
std::unique_ptr<QgsSnapIndicator> mSnapIndicator;

//! The layer maniuplated
//! The layer being maniuplated
QgsVectorLayer *mLayer = nullptr;

//! Geometry to manipulate

0 comments on commit 77f864b

Please sign in to comment.
You can’t perform that action at this time.