Example #1
0
KisBrush::KisBrush(const KisBrush& rhs)
    : KoResource(QString())
    , KisShared()
    , d(new Private)
{
    setBrushTipImage(rhs.brushTipImage());
    d->brushType = rhs.d->brushType;
    d->width = rhs.d->width;
    d->height = rhs.d->height;
    d->spacing = rhs.d->spacing;
    d->hotSpot = rhs.d->hotSpot;
    d->hasColor = rhs.d->hasColor;
    d->angle = rhs.d->angle;
    d->scale = rhs.d->scale;
    d->autoSpacingActive = rhs.d->autoSpacingActive;
    d->autoSpacingCoeff = rhs.d->autoSpacingCoeff;
    setFilename(rhs.filename());

    /**
     * Be careful! The pyramid is shared between two brush objects,
     * therefore you cannot change it, only recreate! That i sthe
     * reason why it is defined as const!
     */
    d->brushPyramid = rhs.d->brushPyramid;

    // don't copy the boundary, it will be regenerated -- see bug 291910
}
Example #2
0
Kross::Api::Object::Ptr KritaCoreFactory::loadBrush(Kross::Api::List::Ptr args)
{
    QString filename = Kross::Api::Variant::toString(args->item(0));
    KisBrush* brush = new KisBrush(filename);
    if(brush->load())
    {
        return new Brush( brush, false );
    } else {
        delete brush;
        throw Kross::Api::Exception::Ptr( new Kross::Api::Exception( i18n("Unknown brush") ) );
        return 0;
    }
}
Example #3
0
KisBrush::KisBrush(const KisBrush& rhs)
    : KoResource("")
    , KisShared()
    , d(new Private)
{
    setBrushTipImage(rhs.brushTipImage());
    d->brushType = rhs.d->brushType;
    d->width = rhs.d->width;
    d->height = rhs.d->height;
    d->spacing = rhs.d->spacing;
    d->hotSpot = rhs.d->hotSpot;
    d->hasColor = rhs.d->hasColor;
    d->angle = rhs.d->angle;
    d->scale = rhs.d->scale;
    setFilename(rhs.filename());
    clearBrushPyramid();
    // don't copy the boundary, it will be regenerated -- see bug 291910
}