Changeset View
Changeset View
Standalone View
Standalone View
libs/ui/canvas/kis_coordinates_converter.h
Show First 20 Lines • Show All 53 Lines • ▼ Show 20 Line(s) | |||||
54 | } | 54 | } | ||
55 | 55 | | |||
56 | class KRITAUI_EXPORT KisCoordinatesConverter: public KoZoomHandler | 56 | class KRITAUI_EXPORT KisCoordinatesConverter: public KoZoomHandler | ||
57 | { | 57 | { | ||
58 | public: | 58 | public: | ||
59 | KisCoordinatesConverter(); | 59 | KisCoordinatesConverter(); | ||
60 | ~KisCoordinatesConverter() override; | 60 | ~KisCoordinatesConverter() override; | ||
61 | 61 | | |||
62 | void setCanvasWidgetSize(QSize size); | 62 | void setCanvasWidgetSize(QSize size, qreal devicePixelRatio); | ||
63 | void setDevicePixelRatio(qreal value); | 63 | void setDevicePixelRatio(qreal value); | ||
64 | void setImage(KisImageWSP image); | 64 | void setImage(KisImageWSP image); | ||
65 | void setDocumentOffset(const QPoint &offset); | 65 | void setDocumentOffsetDevicePixel(const QPoint &offset); | ||
66 | // void setDocumentOffsetLogicalPixel(const QPoint &offset); | ||||
66 | 67 | | |||
67 | QPoint documentOffset() const; | 68 | QPoint documentOffset() const; | ||
68 | qreal rotationAngle() const; | 69 | qreal rotationAngle() const; | ||
69 | 70 | | |||
70 | QPoint rotate(QPointF center, qreal angle); | 71 | QPoint rotate(QPointF center, qreal angle); | ||
71 | QPoint mirror(QPointF center, bool mirrorXAxis, bool mirrorYAxis); | 72 | QPoint mirror(QPointF center, bool mirrorXAxis, bool mirrorYAxis); | ||
72 | bool xAxisMirrored() const; | 73 | bool xAxisMirrored() const; | ||
73 | bool yAxisMirrored() const; | 74 | bool yAxisMirrored() const; | ||
▲ Show 20 Lines • Show All 79 Lines • ▼ Show 20 Line(s) | |||||
153 | private: | 154 | private: | ||
154 | friend class KisZoomAndPanTest; | 155 | friend class KisZoomAndPanTest; | ||
155 | 156 | | |||
156 | QPointF centeringCorrection() const; | 157 | QPointF centeringCorrection() const; | ||
157 | void correctOffsetToTransformation(); | 158 | void correctOffsetToTransformation(); | ||
158 | void correctTransformationToOffset(); | 159 | void correctTransformationToOffset(); | ||
159 | void recalculateTransformations(); | 160 | void recalculateTransformations(); | ||
160 | 161 | | |||
162 | QSizeF canvasWidgetLogicalPixelSize() const; | ||||
163 | QPointF documentOffsetLogicalPixel() const; | ||||
164 | | ||||
161 | private: | 165 | private: | ||
162 | struct Private; | 166 | struct Private; | ||
163 | Private * const m_d; | 167 | Private * const m_d; | ||
164 | }; | 168 | }; | ||
165 | 169 | | |||
166 | #endif /* KIS_COORDINATES_CONVERTER_H */ | 170 | #endif /* KIS_COORDINATES_CONVERTER_H */ |