Skip to content

File RangeGesture.hpp

File List > axis > internal > RangeGesture.hpp

Go to the documentation of this file

//
// SPDX-FileCopyrightText: 2026 Michal Grabarczyk
// SPDX-License-Identifier: GPL-3.0-only WITH Universal-FOSS-exception-1.0
//
// This file is also available under a separate commercial license.
// See COMMERCIAL-LICENSING.md for contact information.
//
#pragma once

#include <QtGlobal>

namespace QAccelPlot::Internal {

struct ValueRange {
    qreal min{0.0}; 
    qreal max{1.0}; 
};

[[nodiscard]] ValueRange pannedRange(const ValueRange& range, qreal fraction, bool logarithmic);

[[nodiscard]] ValueRange zoomedRange(const ValueRange& range, qreal factor, qreal anchorRatio, bool logarithmic);

[[nodiscard]] qreal wheelZoomFactor(qreal zoomScaleFactor, bool zoomingIn, qreal steps = 1.0);

} // namespace QAccelPlot::Internal