summaryrefslogtreecommitdiffstats
path: root/src/object/sp-dimensions.h
blob: 337b6d1533d42454efc42c97d58ef5e3992f1656 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// SPDX-License-Identifier: GPL-2.0-or-later
#ifndef SP_DIMENSIONS_H__
#define SP_DIMENSIONS_H__

/*
 * dimensions helper class, common code used by root, image and others
 *
 * Authors:
 *  Shlomi Fish
 * Copyright (C) 2017 Shlomi Fish, authors
 *
 * Released under dual Expat and GNU GPL, read the file 'COPYING' for more information
 *
 */

#include "svg/svg-length.h"

namespace Inkscape::XML {
class Node;
} // namespace Inkscape::XML

class SPItemCtx;

class SPDimensions {

public:
    SVGLength x;
    SVGLength y;
    SVGLength width;
    SVGLength height;
    void calcDimsFromParentViewport(const SPItemCtx *ictx, bool assign_to_set = false,
                                    SPDimensions const *use = nullptr);
    void writeDimensions(Inkscape::XML::Node *) const;
};

#endif

/*
  Local Variables:
  mode:c++
  c-file-style:"stroustrup"
  c-basic-offset:2
  c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
  indent-tabs-mode:nil
  fill-column:99
  End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=2:tabstop=8:softtabstop=2:fileencoding=utf-8:textwidth=99 :