Changeset View
Changeset View
Standalone View
Standalone View
lib/documentview/abstractimageview.cpp
Show First 20 Lines • Show All 271 Lines • ▼ Show 20 Line(s) | 270 | if (on) { | |||
---|---|---|---|---|---|
272 | setZoom(computeZoomToFit()); | 272 | setZoom(computeZoomToFit()); | ||
273 | } | 273 | } | ||
274 | // We do not set zoom to 1 if zoomToFit is off, this is up to the code | 274 | // We do not set zoom to 1 if zoomToFit is off, this is up to the code | ||
275 | // calling us. It may went to zoom to some other level and/or to zoom on | 275 | // calling us. It may went to zoom to some other level and/or to zoom on | ||
276 | // a particular position | 276 | // a particular position | ||
277 | zoomToFitChanged(d->mZoomToFit); | 277 | zoomToFitChanged(d->mZoomToFit); | ||
278 | } | 278 | } | ||
279 | 279 | | |||
280 | void AbstractImageView::setZoomToFill(bool on) | 280 | void AbstractImageView::setZoomToFill(bool on, const QPointF& center) | ||
281 | { | 281 | { | ||
282 | d->mZoomToFill = on; | 282 | d->mZoomToFill = on; | ||
283 | if (on) { | 283 | if (on) { | ||
284 | d->mZoomToFit = false; | 284 | d->mZoomToFit = false; | ||
285 | setZoom(computeZoomToFill()); | 285 | setZoom(computeZoomToFill(), center); | ||
286 | } | 286 | } | ||
287 | // We do not set zoom to 1 if zoomToFit is off, this is up to the code | 287 | // We do not set zoom to 1 if zoomToFit is off, this is up to the code | ||
288 | // calling us. It may went to zoom to some other level and/or to zoom on | 288 | // calling us. It may went to zoom to some other level and/or to zoom on | ||
289 | // a particular position | 289 | // a particular position | ||
290 | zoomToFillChanged(d->mZoomToFill); | 290 | zoomToFillChanged(d->mZoomToFill); | ||
291 | } | 291 | } | ||
292 | 292 | | |||
293 | const QPixmap& AbstractImageView::alphaBackgroundTexture() const | 293 | const QPixmap& AbstractImageView::alphaBackgroundTexture() const | ||
▲ Show 20 Lines • Show All 327 Lines • Show Last 20 Lines |