[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    koffice/krita/plugins/paintops
From:       Lukáš Tvrdý <lukast.dev () gmail ! com>
Date:       2010-09-08 10:40:50
Message-ID: 20100908104050.122DAAC857 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1172985 by lukast:

Fix brush outline offset for the predefined brushes.

Render the brush mask outline without brush scale and brush rotation.
Do the rotation and the scale in the rendering of the path.

 M  +3 -20     libbrush/kis_brush.cpp  
 M  +1 -1      libbrush/kis_brush.h  
 M  +2 -2      libpaintop/kis_brush_based_paintop_settings.cpp  


--- trunk/koffice/krita/plugins/paintops/libbrush/kis_brush.cpp #1172984:1172985
@@ -1169,29 +1169,12 @@
     KisFixedPaintDeviceSP dev;
 
     if (brushType() == IMAGE || brushType() == PIPE_IMAGE) {
-        dev = paintDevice(KoColorSpaceRegistry::instance()->rgb8(), 1.0, 0.0, \
KisPaintInformation()); +        dev = \
paintDevice(KoColorSpaceRegistry::instance()->rgb8(), 1.0/scale(), -angle(), \
KisPaintInformation());  } else {
         const KoColorSpace* cs = KoColorSpaceRegistry::instance()->rgb8();
         dev = new KisFixedPaintDevice(cs);
-        mask(dev, KoColor(Qt::black, cs) , 1.0/scale(), 1.0/scale(), 0.0, \
                KisPaintInformation());
-#if 0
-        KisQImagemaskSP amask = mask(KisPaintInformation());
-        const KoColorSpace* cs = \
                KoColorSpaceRegistry::instance()->colorSpace("RGBA", 0);
-        dev = new KisPaintDevice(cs, "tmp for generateBoundary");
-
-        KisHLineIteratorPixel it = dev->createHLineIterator(0, 0, w);
-
-        for (int y = 0; y < h; y++) {
-            int x = 0;
-
-            while (!it.isDone()) {
-                cs->setAlpha(it.rawData(), amask->alphaAt(x++, y), 1);
-                ++it;
+        mask(dev, KoColor(Qt::black, cs) , 1.0/scale(), 1.0/scale(), -angle(), \
KisPaintInformation());  }
-            it.nextRow();
-        }
-#endif
-    }
 
     d->boundary = new KisBoundary(dev);
     d->boundary->generateBoundary();
@@ -1219,7 +1202,7 @@
   d->angle = _rotation;
 }
 
-qreal KisBrush::angle()
+qreal KisBrush::angle() const
 {
   return d->angle;
 }
--- trunk/koffice/krita/plugins/paintops/libbrush/kis_brush.h #1172984:1172985
@@ -268,7 +268,7 @@
     virtual void setScale(qreal _scale);
     qreal scale() const;
     virtual void setAngle(qreal _angle);
-    qreal angle();
+    qreal angle() const;
 protected:
 
     KisBrush(const KisBrush& rhs);
--- trunk/koffice/krita/plugins/paintops/libpaintop/kis_brush_based_paintop_settings.cpp \
#1172984:1172985 @@ -86,11 +86,11 @@
         }
         
         KisBrushSP brush = options->brush();
-        QPointF hotSpot = brush->hotSpot(1.0,1.0);
+        QPointF hotSpot = brush->hotSpot(1.0/brush->scale(),1.0/brush->scale(), \
-brush->angle());  
         QTransform m;
         m.reset();
-        m.rotateRadians(-rotation); 
+        m.rotateRadians(-rotation - brush->angle()); 
         m.scale(brush->scale() * scale, brush->scale() * scale);
         m.translate(-hotSpot.x(), -hotSpot.y());
         


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic