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

List:       koffice-devel
Subject:    kdchart: new and old bugs
From:       Dag Andersen <danders () get2net ! dk>
Date:       2010-11-04 11:24:41
Message-ID: 201011041224.42075.danders () get2net ! dk
[Download RAW message or body]

Hi,
since 2.4 was introduced charts with planes sharing axis does not work.

New bug: Clipping has been introduced in BarDiagram::paint(PaintContext*ctx).
I haven't found exactly where things go wrong, there is a lot transformations 
in there, so the attached patch is just a work-around.

Old bug: Hiding grid. The wrong plane is checked to see if grid shall be 
hidden in CartesianGrid::drawGrid(PaintContext*context). This was fixed in 2.3 
but somehow didn't make into 2.4. Was that on purpose or just a misstake?

See att pathches.
-- 
Mvh.
Dag Andersen

["clipping.diff" (text/x-patch)]

Index: KDChartBarDiagram.cpp
===================================================================
--- KDChartBarDiagram.cpp	(revision 1184626)
+++ KDChartBarDiagram.cpp	(working copy)
@@ -389,8 +389,11 @@
 
     // Only paint elements that are in the paint context's rectangle
     // (in this case boundaries of the diagram, see paintEvent())
-    ctx->painter()->setClipping( true );
-    ctx->painter()->setClipRect( ctx->rectangle() );
+    // HACK: If planes share axes clipping does not work, at least in bar diagrams  (danders)
+    if ( plane == ctx->coordinatePlane() ) {
+        ctx->painter()->setClipping( true );
+        ctx->painter()->setClipRect( ctx->rectangle() );
+    }
 
     // paint different bar types Normal - Stacked - Percent - Default Normal
     d->implementor->paint( ctx );

["grid.diff" (text/x-patch)]

Index: KDChartBarDiagram.cpp
===================================================================
--- KDChartBarDiagram.cpp	(revision 1184626)
+++ KDChartBarDiagram.cpp	(working copy)
@@ -389,8 +389,11 @@
 
     // Only paint elements that are in the paint context's rectangle
     // (in this case boundaries of the diagram, see paintEvent())
-    ctx->painter()->setClipping( true );
-    ctx->painter()->setClipRect( ctx->rectangle() );
+    // HACK: If planes share axes, clipping does not work, at least in bar diagrams  (danders)
+    if ( plane == ctx->coordinatePlane() ) {
+        ctx->painter()->setClipping( true );
+        ctx->painter()->setClipRect( ctx->rectangle() );
+    }
 
     // paint different bar types Normal - Stacked - Percent - Default Normal
     d->implementor->paint( ctx );


_______________________________________________
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