View Issue Details

IDProjectCategoryView StatusLast Update
0014535LazarusLCLpublic2009-09-08 12:41
ReporterAnton Kavalenka Assigned ToJesus Reyes  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Platformx86_64OSDebian GNU/Linux 
Product Version0.9.29 (SVN) 
Target Version0.9.30Fixed in Version0.9.29 (SVN) 
Summary0014535: TPostScriptCanvas.Polyline does not flush output buffer whe color of line has not changed
DescriptionTPostScriptCanvas.Polyline flushes output stringlist only if the color of Polyline is other than cached color value.

Patch provided.
Steps To ReproduceI think the patch is trivial.

The code below would not paint Polyline.
cnv:=Printer.Canvas;
cnv.Pen.Color:=clRed;
cnv.MoveTo(0,0);
cnv.LineTo(100,100);
cnv.PolyLine([150,150,200,210,220,225]);
Additional InformationThe patch also resets lines style and finalizes clip path with the stroke command.
TagsNo tags attached.
Fixed in Revision21607
LazTarget0.9.30
WidgetsetGTK 2
Attached Files

Activities

2009-09-07 15:40

 

psclip-polyline.patch (930 bytes)   
Index: postscriptcanvas.pas
===================================================================
--- postscriptcanvas.pas	(revision 21597)
+++ postscriptcanvas.pas	(working copy)
@@ -1522,14 +1522,13 @@
       Write(Format('%f %f lineto',[pp.fx,pp.fy],FFs),Lst);
     end;
 
-    if (Pen.Color<>clNone) and ((Pen.Color<>Brush.Color) or (Brush.Style<>bsSolid)) then
-    begin
-      UpdateLineColor(clNone);
-      UpdateLineWidth;
-      UpdateLineStyle;
-      Write(Lst);
-      write('stroke');
-    end;
+    UpdateLineColor(clNone);
+    UpdateLineWidth;
+    UpdateLineStyle;
+
+    write(Lst);
+    write('stroke');
+
   finally
     Lst.Free;
   end;
@@ -2186,8 +2185,10 @@
   Self.Write('gsave');
   Self.WriteComment('This is clip path');
   inc(fSaveCount);
+  Self.WriteB('[] 0 setdash');
   psDrawRect(ARect);
   Self.WriteB('clip');
+  Self.WriteB('stroke');
   Self.Write(fBuffer);
  // Self.MovetoLastpos;
 
psclip-polyline.patch (930 bytes)   

Jesus Reyes

2009-09-08 08:16

developer   ~0030526

Applied, thanks

Anton Kavalenka

2009-09-08 12:41

reporter   ~0030535

Thank You!

Issue History

Date Modified Username Field Change
2009-09-07 15:40 Anton Kavalenka New Issue
2009-09-07 15:40 Anton Kavalenka File Added: psclip-polyline.patch
2009-09-07 15:40 Anton Kavalenka Widgetset => GTK 2
2009-09-07 16:03 Vincent Snijders LazTarget => 0.9.30
2009-09-07 16:03 Vincent Snijders Assigned To => Jesus Reyes
2009-09-07 16:03 Vincent Snijders Status new => confirmed
2009-09-07 16:03 Vincent Snijders Target Version => 0.9.30
2009-09-07 16:03 Vincent Snijders Status confirmed => assigned
2009-09-08 08:16 Jesus Reyes Fixed in Revision => 21607
2009-09-08 08:16 Jesus Reyes Status assigned => resolved
2009-09-08 08:16 Jesus Reyes Fixed in Version => 0.9.29 (SVN)
2009-09-08 08:16 Jesus Reyes Resolution open => fixed
2009-09-08 08:16 Jesus Reyes Note Added: 0030526
2009-09-08 12:41 Anton Kavalenka Status resolved => closed
2009-09-08 12:41 Anton Kavalenka Note Added: 0030535