Commit 581200f1 authored by Stefan Nikolaus's avatar Stefan Nikolaus

Zooming Add conversion methods for sizes.

		Sorry, I forgot to implement those in the first run.

svn path=/trunk/koffice/; revision=658717
parent abc8e2c2
......@@ -49,6 +49,16 @@ QRectF KisImageViewConverter::viewToDocument( const QRectF &viewRect ) const
QSizeF(viewToDocumentX(viewRect.width()), viewToDocumentY(viewRect.height())) );
}
QSizeF KisImageViewConverter::documentToView( const QSizeF &documentSize ) const
{
return QSizeF(documentToViewX(documentSize.width()), documentToViewY(documentSize.height()));
}
QSizeF KisImageViewConverter::viewToDocument( const QSizeF &viewSize ) const
{
return QSizeF(viewToDocumentX(viewSize.width()), viewToDocumentY(viewSize.height()));
}
void KisImageViewConverter::zoom(double *zoomX, double *zoomY) const
{
Q_ASSERT(zoomX);
......
......@@ -46,6 +46,10 @@ public:
QRectF documentToView( const QRectF &documentRect ) const;
/// convert from krita to flake units
QRectF viewToDocument( const QRectF &viewRect ) const;
/// convert from krita to flake units
QSizeF documentToView( const QSizeF& documentSize ) const;
/// convert from krita to flake units
QSizeF viewToDocument( const QSizeF& viewSize ) const;
/// convert from flake to krita units
inline double documentToViewX( double documentX ) const { return documentX * m_image->xRes(); }
/// convert from flake to krita units
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment