From kde-commits Sat Dec 31 23:00:51 2005 From: Bart Coppens Date: Sat, 31 Dec 2005 23:00:51 +0000 To: kde-commits Subject: koffice/krita/ui Message-Id: <1136070051.281453.15545.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=113607006209871 SVN commit 492995 by coppens: And fix the custom animated brush creation as well... M +9 -6 kis_custom_brush.cc --- trunk/koffice/krita/ui/kis_custom_brush.cc #492994:492995 @@ -35,6 +35,7 @@ #include "kis_custom_brush.h" #include "kis_resource_mediator.h" #include "kis_resourceserver.h" +#include "kis_paint_layer.h" KisCustomBrush::KisCustomBrush(QWidget *parent, const char* name, const QString& caption, KisView* view) : KisWdgCustomBrush(parent, name), m_view(view) @@ -120,23 +121,25 @@ kdDebug() << "Creating animated!" << endl; -/*LAYERREMOVE // For each layer in the current image, create a new image, and add it to the list QValueVector< QValueVector > devices; devices.push_back(QValueVector()); int w = img -> width(); int h = img -> height(); - for (uint i = 0; i < img -> layers().count(); i++) { - if (!img -> layer(i) -> visible()) - continue; - devices.at(0).push_back(img -> layer(i).data()); + // We only loop over the rootLayer. Since we actually should have a layer selection + // list, no need to elaborate on that here and now + KisLayer* layer = img -> rootLayer() -> firstChild(); + while (layer) { + KisPaintLayer* paint = 0; + if (layer -> visible() && (paint = dynamic_cast(layer))) + devices.at(0).push_back(paint -> paintDevice()); + layer = layer -> nextSibling(); } QValueVector modes; modes.push_back(KisPipeBrushParasite::Incremental); // FIXME m_brush = new KisImagePipeBrush(img -> name(), w, h, devices, modes); -*/ }