Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Resolved using signed/unsigned value for map layer transparency
git-svn-id: http://svn.osgeo.org/qgis/trunk@5145 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Apr 3, 2006
1 parent aa688f1 commit 1c0b234
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/gui/qgsmaplayer.h
Expand Up @@ -304,7 +304,7 @@ class QgsMapLayer : public QObject

public slots:
/** \brief Mutator for transparency level. Should be between 0 and 255 */
virtual void setTransparency(int)=0; //
virtual void setTransparency(unsigned int)=0;
//! event handler for when a coordinate transofrm fails due to bad vertex error
virtual void invalidTransformInput();

Expand Down
7 changes: 5 additions & 2 deletions src/gui/qgsvectorlayer.cpp
Expand Up @@ -3448,12 +3448,15 @@ inline void QgsVectorLayer::transformPoints(
// position on map canvas
mtp->transformInPlace(x, y);
}

unsigned int QgsVectorLayer::getTransparency()
{
return transparencyLevelInt;
}

//should be between 0 and 255
void QgsVectorLayer::setTransparency(int theInt)
void QgsVectorLayer::setTransparency(unsigned int theInt)
{
transparencyLevelInt=theInt;
} // QgsRasterLayer::setTransparency(int theInt)
} // QgsRasterLayer::setTransparency(unsigned int theInt)

2 changes: 1 addition & 1 deletion src/gui/qgsvectorlayer.h
Expand Up @@ -172,7 +172,7 @@ const QString displayField() const { return fieldIndex; }
public slots:

/** \brief Mutator for transparency level. Should be between 0 and 255 */
void setTransparency(int); //
void setTransparency(unsigned int);

void inOverview( bool );

Expand Down
4 changes: 2 additions & 2 deletions src/raster/qgsrasterlayer.cpp
Expand Up @@ -3822,7 +3822,7 @@ void QgsRasterLayer::popupTransparencySliderMoved(int theInt)


//should be between 0 and 255
void QgsRasterLayer::setTransparency(int theInt)
void QgsRasterLayer::setTransparency(unsigned int theInt)
{
#ifdef QGISDEBUG
std::cout << "Set transparency called with : " << theInt << std::endl;
Expand All @@ -3834,7 +3834,7 @@ void QgsRasterLayer::setTransparency(int theInt)
mTransparencySlider->setValue(255-theInt);
}
transparencyLevelInt=theInt;
} // QgsRasterLayer::setTransparency(int theInt)
} // QgsRasterLayer::setTransparency(unsigned int theInt)



Expand Down
2 changes: 1 addition & 1 deletion src/raster/qgsrasterlayer.h
Expand Up @@ -799,7 +799,7 @@ class QgsRasterLayer : public QgsMapLayer

public slots:
/** \brief Mutator for transparency level. Should be between 0 and 255 */
void setTransparency(int); //
void setTransparency(unsigned int);
/**
* Convert this raster to another format
*/
Expand Down

0 comments on commit 1c0b234

Please sign in to comment.