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

List:       koffice-devel
Subject:    Re: ShapeSelector
From:       "Sven Langkamp" <sven.langkamp () gmail ! com>
Date:       2006-12-17 0:48:32
Message-ID: 478b087a0612161648k51d643ao20d3cbca13550c0f () mail ! gmail ! com
[Download RAW message or body]

On 12/16/06, Boudewijn Rempt <boud@valdyas.org> wrote:
> On Friday 15 December 2006 12:50, Thomas Zander wrote:
> > In Krita this also works; kinda.  I got a crash. From the backtrace I
> think
> > its not my fault. But please let me know if you think otherwise.
>
> Yes, inserting any shape in krita causes a crash. I was working on that when
> I
> had to go into hospital. Back home now, but not coding yet.

The attached hack(very very ugly ;) ) allows to insert flake shapes in Krita.

The rootLayerShape has to be a KisLayerContainerShape otherwise it
will crash after a failed dynamic_cast in addShape.
An for some reason layer->inherits( "KisShapeLayer" ) doesn't work on
a KisShapeLayer.

["kritaflake.diff" (text/x-diff)]

Index: krita/ui/kis_doc2.cc
===================================================================
--- krita/ui/kis_doc2.cc	(Revision 614143)
+++ krita/ui/kis_doc2.cc	(Arbeitskopie)
@@ -217,7 +217,7 @@
 
             m_currentImage = currentImage;
 
-            KisLayerShape * rootLayerShape = new KisLayerShape( 0, \
currentImage->rootLayer() ); +            KisLayerContainerShape * rootLayerShape = \
new KisLayerContainerShape( 0, currentImage->rootLayer() );  
 
             activeLayerShape = rootLayerShape;
@@ -1368,7 +1368,7 @@
     else if ( layer->inherits( "KisPaintLayer" )  || layer->inherits( \
"KisAdjustmentLayer" ) ) {  shape = new KisLayerShape( parent, layer );
     }
-    else if ( layer->inherits( "KisShapeLayer" ) ) {
+    else if ( dynamic_cast<KisShapeLayer*>( layer.data() ) != 0){
         shape = dynamic_cast<KisShapeLayer*>( layer.data() );
         Q_ASSERT( shape );
     }



_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel


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

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