1
/* This file is part of the KDE project
2
Copyright (C) 2002, The Karbon Developers
4
This library is free software; you can redistribute it and/or
5
modify it under the terms of the GNU Library General Public
6
License as published by the Free Software Foundation; either
7
version 2 of the License, or (at your option) any later version.
9
This library is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
Library General Public License for more details.
14
You should have received a copy of the GNU Library General Public License
15
along with this library; see the file COPYING.LIB. If not, write to
16
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17
Boston, MA 02111-1307, USA.
23
#include "vtransformnodes.h"
26
VTransformNodes::VTransformNodes( const QWMatrix& m )
32
VTransformNodes::visitVSubpath( VSubpath& path )
35
while( path.current() )
37
if( path.current()->isCurve() )
39
if( !path.current()->knotIsSelected() &&
40
path.current()->pointIsSelected( 1 ) &&
41
path.current()->next() &&
42
path.current()->next()->isCurve() &&
43
!path.current()->next()->pointIsSelected( 0 ) &&
44
path.current()->isSmooth() )
46
// Do extra reverse trafo for smooth beziers
47
QWMatrix m2( m_matrix.m11(), m_matrix.m12(), m_matrix.m21(), m_matrix.m22(),
48
-m_matrix.dx(), -m_matrix.dy() );
49
path.current()->next()->setPoint( 0, path.current()->next()->point( 0 ).transform( m2 ) );
51
if( path.current()->pointIsSelected( 0 ) &&
52
path.current()->prev() &&
53
path.current()->prev()->isCurve() &&
54
!path.current()->prev()->knotIsSelected() &&
55
!path.current()->prev()->pointIsSelected( 1 ) &&
56
path.current()->prev()->isSmooth() )
58
// Do extra reverse trafo for smooth beziers
59
QWMatrix m2( m_matrix.m11(), m_matrix.m12(), m_matrix.m21(), m_matrix.m22(),
60
-m_matrix.dx(), -m_matrix.dy() );
61
path.current()->prev()->setPoint( 1, path.current()->prev()->point( 1 ).transform( m2 ) );
65
for( uint i = 0; i < path.current()->degree(); ++i )
67
if( path.current()->pointIsSelected( i ) )
68
path.current()->setPoint( i, path.current()->point( i ).transform( m_matrix ) );