Changeset View
Changeset View
Standalone View
Standalone View
libs/ui/canvas/kis_canvas2.cpp
Show First 20 Lines • Show All 214 Lines • ▼ Show 20 Line(s) | 213 | { | |||
---|---|---|---|---|---|
215 | KisConfig cfg(true); | 215 | KisConfig cfg(true); | ||
216 | m_d->vastScrolling = cfg.vastScrolling(); | 216 | m_d->vastScrolling = cfg.vastScrolling(); | ||
217 | m_d->lodAllowedInImage = cfg.levelOfDetailEnabled(); | 217 | m_d->lodAllowedInImage = cfg.levelOfDetailEnabled(); | ||
218 | 218 | | |||
219 | createCanvas(cfg.useOpenGL()); | 219 | createCanvas(cfg.useOpenGL()); | ||
220 | 220 | | |||
221 | setLodAllowedInCanvas(m_d->lodAllowedInImage); | 221 | setLodAllowedInCanvas(m_d->lodAllowedInImage); | ||
222 | m_d->animationPlayer = new KisAnimationPlayer(this); | 222 | m_d->animationPlayer = new KisAnimationPlayer(this); | ||
223 | connect(m_d->view->canvasController()->proxyObject, SIGNAL(moveDocumentOffset(QPoint)), SLOT(documentOffsetMoved(QPoint))); | 223 | connect(m_d->view->canvasController()->proxyObject, SIGNAL(moveDocumentOffsetDevicePixel(QPoint)), SLOT(documentDevicePixelOffsetMoved(QPoint))); | ||
224 | connect(KisConfigNotifier::instance(), SIGNAL(configChanged()), SLOT(slotConfigChanged())); | 224 | connect(KisConfigNotifier::instance(), SIGNAL(configChanged()), SLOT(slotConfigChanged())); | ||
225 | 225 | | |||
226 | /** | 226 | /** | ||
227 | * We switch the shape manager every time vector layer or | 227 | * We switch the shape manager every time vector layer or | ||
228 | * shape selection is activated. Flake does not expect this | 228 | * shape selection is activated. Flake does not expect this | ||
229 | * and connects all the signals of the global shape manager | 229 | * and connects all the signals of the global shape manager | ||
230 | * to the clients in the constructor. To workaround this we | 230 | * to the clients in the constructor. To workaround this we | ||
231 | * forward the signals of local shape managers stored in the | 231 | * forward the signals of local shape managers stored in the | ||
▲ Show 20 Lines • Show All 812 Lines • ▼ Show 20 Line(s) | |||||
1044 | 1044 | | |||
1045 | } | 1045 | } | ||
1046 | 1046 | | |||
1047 | KisImageWSP KisCanvas2::currentImage() const | 1047 | KisImageWSP KisCanvas2::currentImage() const | ||
1048 | { | 1048 | { | ||
1049 | return m_d->view->image(); | 1049 | return m_d->view->image(); | ||
1050 | } | 1050 | } | ||
1051 | 1051 | | |||
1052 | void KisCanvas2::documentOffsetMoved(const QPoint &documentOffset) | 1052 | void KisCanvas2::documentDevicePixelOffsetMoved(const QPoint &documentOffset) | ||
1053 | { | 1053 | { | ||
1054 | QPointF offsetBefore = m_d->coordinatesConverter->imageRectInViewportPixels().topLeft(); | 1054 | QPointF offsetBefore = m_d->coordinatesConverter->imageRectInViewportPixels().topLeft(); | ||
1055 | m_d->coordinatesConverter->setDocumentOffset(documentOffset); | 1055 | m_d->coordinatesConverter->setDocumentOffsetDevicePixel(documentOffset); | ||
1056 | QPointF offsetAfter = m_d->coordinatesConverter->imageRectInViewportPixels().topLeft(); | 1056 | QPointF offsetAfter = m_d->coordinatesConverter->imageRectInViewportPixels().topLeft(); | ||
1057 | 1057 | | |||
dkazakov: debug-- | |||||
1058 | QPointF moveOffset = offsetAfter - offsetBefore; | 1058 | QPointF moveOffset = offsetAfter - offsetBefore; | ||
1059 | 1059 | | |||
1060 | if (!m_d->currentCanvasIsOpenGL) | 1060 | if (!m_d->currentCanvasIsOpenGL) | ||
1061 | m_d->prescaledProjection->viewportMoved(moveOffset); | 1061 | m_d->prescaledProjection->viewportMoved(moveOffset); | ||
1062 | 1062 | | |||
1063 | emit documentOffsetUpdateFinished(); | 1063 | emit documentOffsetUpdateFinished(); | ||
1064 | 1064 | | |||
1065 | updateCanvas(); | 1065 | updateCanvas(); | ||
▲ Show 20 Lines • Show All 197 Lines • Show Last 20 Lines |
debug--