Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
sp-dimensions.h
Go to the documentation of this file.
1
// SPDX-License-Identifier: GPL-2.0-or-later
2
#ifndef SP_DIMENSIONS_H__
3
#define SP_DIMENSIONS_H__
4
5
/*
6
* dimensions helper class, common code used by root, image and others
7
*
8
* Authors:
9
* Shlomi Fish
10
* Copyright (C) 2017 Shlomi Fish, authors
11
*
12
* Released under dual Expat and GNU GPL, read the file 'COPYING' for more information
13
*
14
*/
15
16
#include "
svg/svg-length.h
"
17
18
namespace
Inkscape::XML
{
19
class
Node;
20
}
// namespace Inkscape::XML
21
22
class
SPItemCtx
;
23
24
class
SPDimensions
{
25
26
public
:
27
SVGLength
x
;
28
SVGLength
y
;
29
SVGLength
width
;
30
SVGLength
height
;
31
void
calcDimsFromParentViewport
(
const
SPItemCtx
*
ictx
,
bool
assign_to_set
=
false
,
32
SPDimensions
const
*
use
=
nullptr
);
33
void
writeDimensions
(
Inkscape::XML::Node
*)
const
;
34
};
35
36
#endif
37
38
/*
39
Local Variables:
40
mode:c++
41
c-file-style:"stroustrup"
42
c-basic-offset:2
43
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
44
indent-tabs-mode:nil
45
fill-column:99
46
End:
47
*/
48
// vim: filetype=cpp:expandtab:shiftwidth=2:tabstop=8:softtabstop=2:fileencoding=utf-8:textwidth=99 :
Inkscape::XML::Node
Interface for refcounted XML nodes.
Definition
node.h:80
SPDimensions
Definition
sp-dimensions.h:24
SPDimensions::calcDimsFromParentViewport
void calcDimsFromParentViewport(const SPItemCtx *ictx, bool assign_to_set=false, SPDimensions const *use=nullptr)
Update computed x/y/width/height for "percent" units and/or from its referencing clone parent.
Definition
sp-dimensions.cpp:28
SPDimensions::y
SVGLength y
Definition
sp-dimensions.h:28
SPDimensions::height
SVGLength height
Definition
sp-dimensions.h:30
SPDimensions::width
SVGLength width
Definition
sp-dimensions.h:29
SPDimensions::writeDimensions
void writeDimensions(Inkscape::XML::Node *) const
Write the geometric properties (x/y/width/height) to XML attributes, if they are set.
Definition
sp-dimensions.cpp:76
SPDimensions::x
SVGLength x
Definition
sp-dimensions.h:27
SVGLength
SVG length type.
Definition
svg-length.h:22
Inkscape::XML
@Inkscape XML tree.
Definition
actions-svg-processing.h:16
SPItemCtx
Contains transformations to document/viewport and the viewport size.
Definition
sp-item.h:92
svg-length.h
src
object
sp-dimensions.h
Generated on Sun Jun 22 2025 04:02:01 for Inkscape by
1.9.8