MCPcopy Create free account
hub / github.com/KDE/labplot / zoom

Method zoom

src/backend/worksheet/plots/cartesian/CartesianPlot.cpp:3142–3166  ·  view source on GitHub ↗

! * helper function called in other zoom*() functions * and doing the actual change of the data ranges. * @param x if set to \true the x-range is modified, the y-range for \c false * @param in the "zoom in" is performed if set to \c \true, "zoom out" for \c false */

Source from the content-addressed store, hash-verified

3140 * @param in the "zoom in" is performed if set to \c \true, "zoom out" for \c false
3141 */
3142void CartesianPlot::zoom(int index, const Dimension dim, bool zoom_in, const double relPosSceneRange) {
3143 Q_D(CartesianPlot);
3144
3145 Range<double> range;
3146 if (index == -1) {
3147 QVector<int> zoomedIndices;
3148 for (int i = 0; i < m_coordinateSystems.count(); i++) {
3149 int idx = coordinateSystem(i)->index(dim);
3150 if (zoomedIndices.contains(idx))
3151 continue;
3152 zoom(idx, dim, zoom_in, relPosSceneRange);
3153 zoomedIndices.append(idx);
3154 }
3155 return;
3156 }
3157 range = d->range(dim, index);
3158
3159 double factor = m_zoomFactor;
3160 if (zoom_in)
3161 factor = 1. / factor;
3162 range.zoom(factor, d->niceExtend, relPosSceneRange);
3163
3164 if (range.finite())
3165 d->setRange(dim, index, range);
3166}
3167
3168/*!
3169 * helper function called in other shift*() functions

Callers

nothing calls this directly

Calls 7

appendMethod · 0.80
rangeMethod · 0.80
finiteMethod · 0.80
countMethod · 0.45
indexMethod · 0.45
containsMethod · 0.45
setRangeMethod · 0.45

Tested by

no test coverage detected