Skip to content
Permalink
Browse files

#8725: fix texts

  • Loading branch information
ahuarte47 committed Dec 12, 2013
1 parent 4b794a5 commit 566e5bd184a1af26f4ce131793d5a5a4bc459e2d
Showing with 7 additions and 7 deletions.
  1. +1 −1 src/app/qgsoptions.cpp
  2. +6 −6 src/core/qgsmaptopixelgeometrysimplifier.cpp
@@ -525,7 +525,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :

// Default simplify drawing configuration
mSimplifyDrawingGroupBox->setChecked( settings.value( "/qgis/simplifyDrawingHints", (int)QgsVectorLayer::DefaultSimplification ).toInt() != QgsVectorLayer::NoSimplification );
mSimplifyDrawingSlider->setValue( (int)(5.0f * (settings.value( "/qgis/simplifyDrawingTol", 1.0F ).toFloat()-1)) );
mSimplifyDrawingSlider->setValue( (int)(5.0f * (settings.value( "/qgis/simplifyDrawingTol", QGis::DEFAULT_MAPTOPIXEL_THRESHOLD ).toFloat()-1)) );
mSimplifyDrawingPanel->setVisible( mSimplifyDrawingSlider->value()>0 );

// Slightly awkard here at the settings value is true to use QImage,
@@ -85,18 +85,18 @@ inline static QgsRectangle calculateBoundingBox( QGis::WkbType wkbType, unsigned
memcpy( &x, wkb, sizeof( double ) ); wkb += sizeOfDoubleX;
memcpy( &y, wkb, sizeof( double ) ); wkb += sizeOfDoubleY;

if (xmin>x) xmin = x;
if (ymin>y) ymin = y;
if (xmax<x) xmax = x;
if (ymax<y) ymax = y;
if ( xmin > x ) xmin = x;
if ( ymin > y ) ymin = y;
if ( xmax < x ) xmax = x;
if ( ymax < y ) ymax = y;
}
wkb = wkb2;

return QgsRectangle( xmin, ymin, xmax, ymax );
}

//! Generalize the WKB-geometry using the BBOX of the original geometry
inline static bool generalizeGeometry( QGis::WkbType wkbType, unsigned char* sourceWkb, size_t sourceWkbSize, unsigned char* targetWkb, size_t& targetWkbSize, const QgsRectangle& envelope, bool writeHeader )
inline static bool generalizeWkbGeometry( QGis::WkbType wkbType, unsigned char* sourceWkb, size_t sourceWkbSize, unsigned char* targetWkb, size_t& targetWkbSize, const QgsRectangle& envelope, bool writeHeader )
{
unsigned char* wkb2 = targetWkb;
unsigned int geometryType = QGis::singleType( QGis::flatType( wkbType ) );
@@ -180,7 +180,7 @@ bool QgsMapToPixelSimplifier::simplifyWkbGeometry( int simplifyFlags, QGis::WkbT
// Can replace the geometry by its BBOX ?
if ( ( simplifyFlags & QgsMapToPixelSimplifier::SimplifyEnvelope ) && (envelope.xMaximum()-envelope.xMinimum()) < map2pixelTol && (envelope.yMaximum()-envelope.yMinimum()) < map2pixelTol )
{
canbeGeneralizable = generalizeGeometry( wkbType, sourceWkb, sourceWkbSize, targetWkb, targetWkbSize, envelope, writeHeader );
canbeGeneralizable = generalizeWkbGeometry( wkbType, sourceWkb, sourceWkbSize, targetWkb, targetWkbSize, envelope, writeHeader );
if (canbeGeneralizable) return true;
}
if (!( simplifyFlags & QgsMapToPixelSimplifier::SimplifyGeometry ) ) canbeGeneralizable = false;

0 comments on commit 566e5bd

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