Changeset View
Changeset View
Standalone View
Standalone View
lib/documentview/svgviewadapter.cpp
Show First 20 Lines • Show All 74 Lines • ▼ Show 20 Line(s) | 64 | { | |||
---|---|---|---|---|---|
75 | applyPendingScrollPos(); | 75 | applyPendingScrollPos(); | ||
76 | completed(); | 76 | completed(); | ||
77 | } | 77 | } | ||
78 | 78 | | |||
79 | void SvgImageView::onZoomChanged() | 79 | void SvgImageView::onZoomChanged() | ||
80 | { | 80 | { | ||
81 | mSvgItem->setScale(zoom()); | 81 | mSvgItem->setScale(zoom()); | ||
82 | adjustItemPos(); | 82 | adjustItemPos(); | ||
83 | update(); | ||||
huoni: This is needed to get rid of artifacts of the select rect left over when zooming an SVG. | |||||
rkflx: Nice, as far as I can see `RasterImageView` is doing something similar. | |||||
83 | } | 84 | } | ||
84 | 85 | | |||
85 | void SvgImageView::onImageOffsetChanged() | 86 | void SvgImageView::onImageOffsetChanged() | ||
86 | { | 87 | { | ||
87 | adjustItemPos(); | 88 | adjustItemPos(); | ||
88 | } | 89 | } | ||
89 | 90 | | |||
90 | void SvgImageView::onScrollPosChanged(const QPointF& /* oldPos */) | 91 | void SvgImageView::onScrollPosChanged(const QPointF& /* oldPos */) | ||
▲ Show 20 Lines • Show All 104 Lines • ▼ Show 20 Line(s) | 195 | { | |||
195 | return d->mView->scrollPos(); | 196 | return d->mView->scrollPos(); | ||
196 | } | 197 | } | ||
197 | 198 | | |||
198 | void SvgViewAdapter::setScrollPos(const QPointF& pos) | 199 | void SvgViewAdapter::setScrollPos(const QPointF& pos) | ||
199 | { | 200 | { | ||
200 | d->mView->setScrollPos(pos); | 201 | d->mView->setScrollPos(pos); | ||
201 | } | 202 | } | ||
202 | 203 | | |||
204 | QRectF SvgViewAdapter::visibleDocumentRect() const | ||||
205 | { | ||||
206 | return QRectF(d->mView->imageOffset(), d->mView->visibleImageSize()); | ||||
207 | } | ||||
208 | | ||||
203 | } // namespace | 209 | } // namespace |
This is needed to get rid of artifacts of the select rect left over when zooming an SVG.
(There are other artifacts from the selection rect that are pre-existing and minor therefore I'm not addressing them here)