~ubuntu-branches/ubuntu/precise/koffice/precise

« back to all changes in this revision

Viewing changes to krita/plugins/paintops/libbrush/kis_boundary.cc

  • 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:
27
27
struct KisBoundary::Private {
28
28
    KisFixedPaintDeviceSP m_device;
29
29
    QVector<QPolygon> m_boundary;
 
30
    QPainterPath path;
30
31
};
31
32
 
32
33
KisBoundary::KisBoundary(KisFixedPaintDeviceSP dev) : d(new Private)
36
37
 
37
38
KisBoundary::~KisBoundary()
38
39
{
 
40
    delete d;
39
41
}
40
42
 
41
43
void KisBoundary::generateBoundary()
45
47
 
46
48
    KisOutlineGenerator generator(d->m_device->colorSpace(), OPACITY_TRANSPARENT_U8);
47
49
    d->m_boundary = generator.outline(d->m_device->data(), 0, 0, d->m_device->bounds().width(), d->m_device->bounds().height());
 
50
 
 
51
    d->path = QPainterPath();
 
52
    foreach(const QPolygon & polygon, d->m_boundary) {
 
53
        d->path.addPolygon(polygon);
 
54
        d->path.closeSubpath();
 
55
    }
 
56
 
48
57
}
49
58
 
50
59
void KisBoundary::paint(QPainter& painter) const
58
67
        painter.drawPolygon(polygon);
59
68
    }
60
69
}
 
70
 
 
71
QPainterPath KisBoundary::path() const
 
72
{
 
73
    return d->path;
 
74
}
 
75