KChart

KChartZoomParameters.h
1/*
2 * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 *
4 * This file is part of the KD Chart library.
5 *
6 * SPDX-License-Identifier: GPL-2.0-or-later
7 */
8
9#ifndef ZOOMPARAMETERS_H
10#define ZOOMPARAMETERS_H
11
12//
13// W A R N I N G
14// -------------
15//
16// This file is not part of the KD Chart API. It exists purely as an
17// implementation detail. This header file may change from version to
18// version without notice, or even be removed.
19//
20// We mean it.
21//
22
23namespace KChart {
24 /**
25 * ZoomParameters stores the center and the factor of zooming internally
26 * \internal
27 */
29 public:
31 : xFactor( 1.0 ),
32 yFactor( 1.0 ),
33 xCenter( 0.5 ),
34 yCenter( 0.5)
35 {
36 }
37
38 ZoomParameters( qreal xFactor, qreal yFactor, const QPointF& center )
39 : xFactor( xFactor ),
40 yFactor( yFactor ),
41 xCenter( center.x() ),
42 yCenter( center.y() )
43 {
44 }
45
46 void setCenter( const QPointF& center )
47 {
48 xCenter = center.x();
49 yCenter = center.y();
50 }
51 const QPointF center() const
52 {
53 return QPointF( xCenter, yCenter );
54 }
55
56 qreal xFactor;
57 qreal yFactor;
58
59 qreal xCenter;
60 qreal yCenter;
61 };
62}
63
64#endif
ZoomParameters stores the center and the factor of zooming internally.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jul 26 2024 11:51:58 by doxygen 1.11.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.