View Issue Details

IDProjectCategoryView StatusLast Update
0032465LazarusLCLpublic2017-09-27 20:30
ReporterVojtech Cihak Assigned ToZeljan Rikalo  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Platformamd64OSLinux 
Product Version1.9 (SVN) 
Summary0032465: Graphic inconsistency Canvas.Pen
DescriptionGraphic drawn by Canvas.Pen is inconsistent now. Qt is broken from revision 53046. Other widgetsets are OK. See attached screenshot - glyphs from EC-Controls.

Guilty patch: https://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/lcl/include/pen.inc?root=lazarus&r1=53046&r2=53045&pathrev=53046
Steps To ReproduceI don't know how to make some meaningful demo. Simply said, lines in QT are one pixel longer than it should be.
Additional InformationLazarus 1.9.0 r55918M FPC 3.0.2 x86_64-linux-qt
TagsNo tags attached.
Fixed in Revision55934
LazTarget-
WidgetsetQT
Attached Files

Relationships

related to 0022646 resolvedBart Broersma Draw line at Pen.Style: = psPattern and Pen.width: = 1. 

Activities

Vojtech Cihak

2017-09-25 04:15

reporter  

compare.png (30,255 bytes)   
compare.png (30,255 bytes)   

Zeljan Rikalo

2017-09-25 17:01

developer  

issue32465fix.diff (1,081 bytes)   
Index: lcl/include/pen.inc
===================================================================
--- lcl/include/pen.inc	(revision 55914)
+++ lcl/include/pen.inc	(working copy)
@@ -389,10 +389,18 @@
     if IsGeometric then
       elpWidth := Width
     else
-      //(https://msdn.microsoft.com/en-us/library/windows/desktop/dd162705(v=vs.85).aspx
-      //https://msdn.microsoft.com/en-us/library/windows/desktop/dd162711(v=vs.85).aspx
-      //Issue #0022646
-      elpWidth := 1;
+    begin
+      // issue #32465, regression from fixing #22646. Pure cosmetic
+      // pen is created via TLogPen, not via TExtLogPen
+      if ((elpPenStyle and PS_STYLE_MASK) = elpPenStyle) and
+          (elpPenStyle <> PS_USERSTYLE) then
+        elpWidth := 0
+      else
+        //(https://msdn.microsoft.com/en-us/library/windows/desktop/dd162705(v=vs.85).aspx
+        //https://msdn.microsoft.com/en-us/library/windows/desktop/dd162711(v=vs.85).aspx
+        //Issue #0022646
+        elpWidth := 1;
+    end;
     elpBrushStyle := BS_SOLID;
     elpColor := TColorRef(FColor);
   end;
issue32465fix.diff (1,081 bytes)   

Zeljan Rikalo

2017-09-25 17:03

developer   ~0103039

IMO, author of the commit forgot that simple pen reference is created via CreatePenIndirect() using TLogPen, not TExtLogPen which he points in msdn documentation. Setting width for cosmetic pens make such pen non-cosmetic at least under qt on all platforms.
@Vojtech please test with attached patch.

Vojtech Cihak

2017-09-25 20:43

reporter   ~0103044

Patch works, thanks. Can someone with Win test whether it does not break the related issue?

Zeljan Rikalo

2017-09-26 11:27

developer   ~0103060

IMO, it should not break anything since regression commit is TExtLogPen related, not TLogPen.

wp

2017-09-26 17:24

developer   ~0103070

> Can someone with Win test whether it does not break the related issue?

I ran the demo accompanying issue 0022646 on Win 10 with this modification in trunk and compared it with 1.8RC4 - no difference.

Zeljan Rikalo

2017-09-26 19:06

developer   ~0103075

Thanks wp

Zeljan Rikalo

2017-09-27 15:18

developer   ~0103096

Please test and close if ok.

Vojtech Cihak

2017-09-27 20:30

reporter   ~0103097

Tested with r55934. Thanks.

Issue History

Date Modified Username Field Change
2017-09-25 04:15 Vojtech Cihak New Issue
2017-09-25 04:15 Vojtech Cihak File Added: compare.png
2017-09-25 12:10 Zeljan Rikalo Relationship added related to 0022646
2017-09-25 17:01 Zeljan Rikalo Assigned To => Zeljan Rikalo
2017-09-25 17:01 Zeljan Rikalo Status new => assigned
2017-09-25 17:01 Zeljan Rikalo File Added: issue32465fix.diff
2017-09-25 17:03 Zeljan Rikalo LazTarget => -
2017-09-25 17:03 Zeljan Rikalo Note Added: 0103039
2017-09-25 17:03 Zeljan Rikalo Status assigned => feedback
2017-09-25 20:43 Vojtech Cihak Note Added: 0103044
2017-09-25 20:43 Vojtech Cihak Status feedback => assigned
2017-09-26 11:27 Zeljan Rikalo Note Added: 0103060
2017-09-26 17:24 wp Note Added: 0103070
2017-09-26 19:06 Zeljan Rikalo Note Added: 0103075
2017-09-27 15:18 Zeljan Rikalo Fixed in Revision => 55934
2017-09-27 15:18 Zeljan Rikalo Note Added: 0103096
2017-09-27 15:18 Zeljan Rikalo Status assigned => resolved
2017-09-27 15:18 Zeljan Rikalo Resolution open => fixed
2017-09-27 20:30 Vojtech Cihak Note Added: 0103097
2017-09-27 20:30 Vojtech Cihak Status resolved => closed