~ubuntu-branches/ubuntu/oneiric/koffice/oneiric-updates

« back to all changes in this revision

Viewing changes to karbon/plugins/tools/KarbonPatternEditStrategy.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2010-10-27 17:52:57 UTC
  • mfrom: (0.12.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20101027175257-s04zqqk5bs8ckm9o
Tags: 1:2.2.83-0ubuntu1
* Merge with Debian git remaining changes:
 - Add build-deps on librcps-dev, opengtl-dev, libqtgtl-dev, freetds-dev,
   create-resources, libspnav-dev
 - Remove needless build-dep on libwv2-dev
 - koffice-libs recommends create-resources
 - krita recommends pstoedit
 - Keep our patches
* New upstream release 2.3 beta 3
  - Remove debian/patches fixed by upstream
  - Update install files

Show diffs side-by-side

added added

removed removed

Lines of Context:
131
131
    // the fixed length of half the average shape dimension
132
132
    m_normalizedLength = 0.25 * (size.width() + size.height());
133
133
    // get the brush tranformation matrix
134
 
    QMatrix brushMatrix;
 
134
    QTransform brushMatrix;
135
135
    KoPatternBackground * fill = dynamic_cast<KoPatternBackground*>(shape()->background());
136
136
    if (fill)
137
 
        brushMatrix = fill->matrix();
 
137
        brushMatrix = fill->transform();
138
138
 
139
139
    // the center handle at the center point of the shape
140
140
    //m_origin = QPointF( 0.5 * size.width(), 0.5 * size.height() );
219
219
    // the direction vector controls the rotation of the pattern
220
220
    QPointF dirVec = m_handles[direction] - m_handles[center];
221
221
    qreal angle = atan2(dirVec.y(), dirVec.x()) * 180.0 / M_PI;
222
 
    QMatrix matrix;
 
222
    QTransform matrix;
223
223
    // the center handle controls the translation
224
224
    matrix.translate(m_handles[center].x(), m_handles[center].y());
225
225
    matrix.rotate(angle);
226
226
 
227
227
    KoPatternBackground newFill(imageCollection());
228
228
    newFill = m_oldFill;
229
 
    newFill.setMatrix(matrix);
 
229
    newFill.setTransform(matrix);
230
230
 
231
231
    return newFill;
232
232
}
256
256
        return;
257
257
 
258
258
    painter.save();
259
 
    painter.setMatrix(m_matrix * painter.matrix());
 
259
    painter.setTransform(m_matrix * painter.transform());
260
260
    painter.setBrush(Qt::NoBrush);
261
261
    painter.drawRect(QRectF(m_handles[origin], m_handles[size]));
262
262
    painter.restore();