#include <KoZoomHandler.h>
This class handles the zooming and DPI stuff (conversions between pt values and pixels).
An instance of KoZoomHandler operates at a given zoom (see setZoomAndResolution() and setZoom()) so there is usually one instance of KoZoomHandler per view.
Definition at line 32 of file KoZoomHandler.h.
◆ KoZoomHandler()
| KoZoomHandler::KoZoomHandler |
( |
| ) |
|
◆ ~KoZoomHandler()
| virtual KoZoomHandler::~KoZoomHandler |
( |
| ) |
|
|
inlinevirtual |
◆ resolutionX()
| double KoZoomHandler::resolutionX |
( |
| ) |
const |
|
inline |
◆ resolutionY()
| double KoZoomHandler::resolutionY |
( |
| ) |
const |
|
inline |
◆ setResolution()
| void KoZoomHandler::setResolution |
( |
double | resolutionX, |
|
|
double | resolutionY ) |
Set a resolution for X and Y, when no zoom applies (e.g.
when painting an embedded document. This will set the zoom to 100, and it will set zoomedResolution[XY] to the resolution[XY] parameters Helper method, equivalent to setZoomAndResolution(100,...).
Definition at line 44 of file KoZoomHandler.cpp.
◆ setZoom()
| void KoZoomHandler::setZoom |
( |
int | zoom | ) |
|
Change the zoom level, keeping the resolution unchanged.
- Parameters
-
| zoom | the zoom factor (e.g. 100 for 100%) |
Definition at line 62 of file KoZoomHandler.cpp.
◆ setZoomAndResolution()
| void KoZoomHandler::setZoomAndResolution |
( |
int | zoom, |
|
|
int | dpiX, |
|
|
int | dpiY ) |
|
virtual |
Change the zoom factor to z (e.g.
150 for 150%) and/or change the resolution, given in DPI. This is done on startup, when zooming, and when printing. The same call combines both so that all the updating done behind the scenes is done only once, even if both zoom and DPI must be changed.
Reimplemented in ContextStyle.
Definition at line 31 of file KoZoomHandler.cpp.
◆ setZoomedResolution()
| void KoZoomHandler::setZoomedResolution |
( |
double | zoomedResolutionX, |
|
|
double | zoomedResolutionY ) |
|
virtual |
Set the zoomed resolution for X and Y.
Compared to the setZoom... methods, this allows to set a different zoom factor for X and for Y.
Definition at line 53 of file KoZoomHandler.cpp.
◆ setZoomMode()
◆ unzoomItX()
| double KoZoomHandler::unzoomItX |
( |
int | x | ) |
const |
|
inline |
◆ unzoomItY()
| double KoZoomHandler::unzoomItY |
( |
int | y | ) |
const |
|
inline |
◆ unzoomPoint()
| KoPoint KoZoomHandler::unzoomPoint |
( |
const TQPoint & | p | ) |
const |
|
inline |
◆ unzoomRect()
| KoRect KoZoomHandler::unzoomRect |
( |
const TQRect & | r | ) |
const |
|
inline |
◆ zoom()
| int KoZoomHandler::zoom |
( |
| ) |
const |
|
inline |
- Returns
- the global zoom factor (e.g. 100 for 100%). Only use this to display to the user, don't use in calculations
Definition at line 97 of file KoZoomHandler.h.
◆ zoomedResolutionX()
| double KoZoomHandler::zoomedResolutionX |
( |
| ) |
const |
|
inline |
- Returns
- the conversion factor between pt and pixel, that takes care of the zoom and the DPI setting. Use zoomIt(pt) instead, though.
Definition at line 52 of file KoZoomHandler.h.
◆ zoomedResolutionY()
| double KoZoomHandler::zoomedResolutionY |
( |
| ) |
const |
|
inline |
◆ zoomFactorX()
| double KoZoomHandler::zoomFactorX |
( |
| ) |
const |
|
inline |
◆ zoomFactorY()
| double KoZoomHandler::zoomFactorY |
( |
| ) |
const |
|
inline |
Zoom factor for Y.
Equivalent to zoomedResolutionY()/resolutionY()
Definition at line 65 of file KoZoomHandler.h.
◆ zoomItX()
| int KoZoomHandler::zoomItX |
( |
double | z | ) |
const |
|
inline |
◆ zoomItY()
| int KoZoomHandler::zoomItY |
( |
double | z | ) |
const |
|
inline |
◆ zoomMode()
◆ zoomPoint()
| TQPoint KoZoomHandler::zoomPoint |
( |
const KoPoint & | p | ) |
const |
|
inline |
◆ zoomRect()
| TQRect KoZoomHandler::zoomRect |
( |
const KoRect & | r | ) |
const |
|
inline |
◆ zoomSize()
| TQSize KoZoomHandler::zoomSize |
( |
const KoSize & | s | ) |
const |
|
inline |
Returns the size in pixels for a input size in points.
This function can return a size with 1 pixel to less, depending on the reference point and the width and/or the zoom level. It's save to use if the starting point is (0/0). You can use it if you don't know the starting point yet (like when inserting a picture), but then please take care of it afterwards, when you know the reference point.
Definition at line 131 of file KoZoomHandler.h.
◆ m_resolutionX
| double KoZoomHandler::m_resolutionX |
|
protected |
◆ m_resolutionY
| double KoZoomHandler::m_resolutionY |
|
protected |
◆ m_zoom
| int KoZoomHandler::m_zoom |
|
protected |
◆ m_zoomedResolutionX
| double KoZoomHandler::m_zoomedResolutionX |
|
protected |
◆ m_zoomedResolutionY
| double KoZoomHandler::m_zoomedResolutionY |
|
protected |
◆ m_zoomMode
The documentation for this class was generated from the following files:
|