diff --git a/python/core/qgsrasterlayer.sip b/python/core/qgsrasterlayer.sip
index 0ba67a7..a04bbab 100644
--- a/python/core/qgsrasterlayer.sip
+++ b/python/core/qgsrasterlayer.sip
@@ -381,6 +381,12 @@ public:
     /** \brief Returns the number of raster units per each raster pixel. In a world file, this is normally the first row (without the sign) */
     double rasterUnitsPerPixel();
 
+    /** \brief Returns the number of horizontal raster units per each raster pixel. In a world file, this is normally the first row (without the sign) */
+    double rasterUnitsPerPixelX();
+
+    /** \brief Returns the number of vertical raster units per each raster pixel. In a world file, this is normally the fourth row (without the sign) */
+    double rasterUnitsPerPixelY();
+
     /** \brief Read color table from GDAL raster band */
 //bool readColorTable( int theBandNumber, QList<QgsColorRampShader::ColorRampItem>* theList );
 
diff --git a/src/app/legend/qgslegend.cpp b/src/app/legend/qgslegend.cpp
index 68140b9..c141b71 100644
--- a/src/app/legend/qgslegend.cpp
+++ b/src/app/legend/qgslegend.cpp
@@ -2008,9 +2008,12 @@ void QgsLegend::legendLayerZoomNative()
       QgsCoordinateTransform ct( r->destinationCrs(), layer->crs() );
       p1 = ct.transform( p1 );
       p2 = ct.transform( p2 );
-      double width = sqrt( p1.sqrDist( p2 ) ); // width of reprojected pixel
-      // This is not perfect of course, we use the resolution in just one direction
-      mMapCanvas->zoomByFactor( qAbs( layer->rasterUnitsPerPixel() / width ) );
+      double width = sqrt( p1.sqrDist( p2 ) ); // diagonal distance of reprojected pixel
+      // use raster layer X and Y rasterUnitsPerPixel
+      mMapCanvas->zoomByFactor(
+            qSqrt( ( layer->rasterUnitsPerPixelX() * layer->rasterUnitsPerPixelX() ) + // calculate diagonal of raster pixel...
+                   ( layer->rasterUnitsPerPixelY() * layer->rasterUnitsPerPixelY() )
+                 ) / width ); // ...and divide to get ratio
     }
     else
     {
diff --git a/src/core/raster/qgsrasterlayer.cpp b/src/core/raster/qgsrasterlayer.cpp
index 10c3b94..00357d8 100755
--- a/src/core/raster/qgsrasterlayer.cpp
+++ b/src/core/raster/qgsrasterlayer.cpp
@@ -2018,11 +2018,45 @@ double QgsRasterLayer::rasterUnitsPerPixel()
 // horisontal one.
 
   //return qAbs( mGeoTransform[1] );
+  return rasterUnitsPerPixelX();  // call on the X units per pixel
+#if 0
   if ( mDataProvider->capabilities() & QgsRasterDataProvider::ExactResolution && mDataProvider->xSize() > 0 )
   {
     return mDataProvider->extent().width() / mDataProvider->xSize();
   }
   return 1;
+#endif
+}
+
+/**
+ * @return the horizontal units per pixel as reported in the  GDAL geotramsform[1]
+ * This is the same as rasterUnitsPerPixel()
+ */
+double QgsRasterLayer::rasterUnitsPerPixelX()
+{
+// We return one raster pixel per map unit pixel
+// One raster pixel can have several raster units...
+
+  if ( mDataProvider->capabilities() & QgsRasterDataProvider::ExactResolution && mDataProvider->xSize() > 0 )
+  {
+    return mDataProvider->extent().width() / mDataProvider->xSize();
+  }
+  return 1;
+}
+
+/**
+ * @return the vertical units per pixel as reported in the  GDAL geotramsform[5]
+ */
+double QgsRasterLayer::rasterUnitsPerPixelY()
+{
+// We return one raster pixel per map unit pixel
+// One raster pixel can have several raster units...
+
+  if ( mDataProvider->capabilities() & QgsRasterDataProvider::ExactResolution && mDataProvider->ySize() > 0 )
+  {
+    return mDataProvider->extent().height() / mDataProvider->ySize();
+  }
+  return 1;
 }
 
 
diff --git a/src/core/raster/qgsrasterlayer.h b/src/core/raster/qgsrasterlayer.h
index a56442b..4ad3223 100644
--- a/src/core/raster/qgsrasterlayer.h
+++ b/src/core/raster/qgsrasterlayer.h
@@ -552,6 +552,12 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
     /** \brief Returns the number of raster units per each raster pixel. In a world file, this is normally the first row (without the sign) */
     double rasterUnitsPerPixel();
 
+    /** \brief Returns the number of horizontal raster units per each raster pixel. In a world file, this is normally the first row (without the sign) */
+    double rasterUnitsPerPixelX();
+
+    /** \brief Returns the number of vertical raster units per each raster pixel. In a world file, this is normally the fourth row (without the sign) */
+    double rasterUnitsPerPixelY();
+
     /** \brief Read color table from GDAL raster band */
     // Keep this for QgsRasterLayerProperties
     bool readColorTable( int theBandNumber, QList<QgsColorRampShader::ColorRampItem>* theList );
