kdchart: new and old bugs

Dag Andersen <[email protected]>
Newsgroups gmane.comp.kde.devel.koffice
Message-ID <[email protected]>
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

_______________________________________________
koffice-devel mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/koffice-devel
clipping.diff (text/x-patch, 806 B)
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, 807 B)
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 );
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.