View Issue Details

IDProjectCategoryView StatusLast Update
0033866LazarusWidgetsetpublic2019-06-15 15:23
ReporterAnton KavalenkaAssigned ToJesus Reyes 
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Platformx86_64OSLinuxOS VersionDebian 10
Product Version1.9 (SVN)Product Build 
Target VersionFixed in Version2.1 (SVN) 
Summary0033866: gtk2: Pen pattern depends on line length
DescriptionSetting the pen style to psDot at some canvas size creates shifted (misaligned) pattern.
It is found that 2nd parameter (0) of
laz_gdk_gc_set_dashes(GC, 0, @ADashes[0], Length(ADashes));

meant to be from GTK2 documentation:
https://developer.gnome.org/gdk2/stable/gdk2-Graphics-Contexts.html#gdk-gc-set-dashes

The dash_offset defines the phase of the pattern, specifying how many pixels into the dash-list the pattern should actually begin.
Steps To ReproduceRun the attached project and try to resize form.
TagsNo tags attached.
Fixed in Revision61378
LazTarget2.0.4
WidgetsetGTK 2
Attached Files

Relationships

related to 0035662 resolvedJesus Reyes Patches Grid: pretty lines for GridLineStyle=psDot on Win32 

Activities

Anton Kavalenka

2018-06-16 10:25

reporter  

laztest109.zip (128,982 bytes)

Anton Kavalenka

2018-06-16 10:26

reporter  

Anton Kavalenka

2018-06-16 10:26

reporter  

Anton Kavalenka

2018-06-16 10:29

reporter  

dashes.diff (448 bytes)
Index: gtk2devicecontext.inc
===================================================================
--- gtk2devicecontext.inc	(revision 58287)
+++ gtk2devicecontext.inc	(working copy)
@@ -1151,7 +1151,7 @@
     for i := Low(ADashes) to High(ADashes) do
       ADashes[i] := ADashes[i] * Multiplier;
 
-    laz_gdk_gc_set_dashes(GC, 0, @ADashes[0], Length(ADashes));
+    laz_gdk_gc_set_dashes(GC, 4096, @ADashes[0], Length(ADashes));
   end;
 
 begin
dashes.diff (448 bytes)

Anton Kavalenka

2018-06-16 10:29

reporter   ~0108926

patch provided

CudaText man

2019-06-11 09:42

reporter   ~0116673

I cannot see the "ugly lines" issue here (Ubuntu 18.x).
Demo paints nice pixel lines.
After applying the fix- still the same.

Jesus Reyes

2019-06-12 08:38

developer   ~0116682

Last edited: 2019-06-12 08:50

View 2 revisions

Found the same, with the attached test project there is no difference between the patched or unpatched code.

But, I made a test under Turbo Delphi, and it doesn't look any similar, beside, it seems line drawing doesn't respect brush style.

I will attach some pictures: SinAnton.png, ConAnton.png, which correspond to linux mint without and with anton patch respectively. The third, how it looks in Turbo Delphi.

In the case that this style "beautiful psDot" wished to be added, then a new TPenStyle have to be added. The proposed patch doesn't implement that...

Jesus Reyes

2019-06-12 08:40

developer  

SinAnton.png (5,962 bytes)
SinAnton.png (5,962 bytes)
conAnton.png (5,947 bytes)
conAnton.png (5,947 bytes)

Jesus Reyes

2019-06-12 08:43

developer  

TurboDelphi.png (4,493 bytes)
TurboDelphi.png (4,493 bytes)

Jesus Reyes

2019-06-12 08:46

developer  

TurboDelphi_dots.png (5,711 bytes)
TurboDelphi_dots.png (5,711 bytes)

Anton Kavalenka

2019-06-12 17:29

reporter   ~0116696

Strange - I've compiled and run my own test on Debian Stretch 9.9
Package: libgtk2.0-0
Version: 2.24.31-2
GNOME 3.22.2 on nVidia proprietary drivers.
No problems.

The "lost" pixels were made on Debian 10 Buster GNOME 3.30 with Intel graphics - maybe that the cause.
I will test again.

Anton Kavalenka

2019-06-12 21:09

reporter   ~0116700

Last edited: 2019-06-12 21:09

View 2 revisions

Still reproducible
Package: libgtk2.0-0
Version: 2.24.32-3
GNOME 3.30.2
Debian Buster/Sid 10
X.Org version: 1.20.3

patch helps

Jesus Reyes

2019-06-13 19:12

developer   ~0116710

Patch applied as it makes no difference in some systems but it fixes a bug in others.
Thanks.

Anton Kavalenka

2019-06-13 19:58

reporter   ~0116712

Looks like GTK2 dashed lines in Debian Unstable is broken
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=869382

Issue History

Date Modified Username Field Change
2018-06-16 10:25 Anton Kavalenka New Issue
2018-06-16 10:25 Anton Kavalenka File Added: laztest109.zip
2018-06-16 10:26 Anton Kavalenka File Added: Здымак экрана, 2018-06-16 11-16-21.png
2018-06-16 10:26 Anton Kavalenka File Added: Здымак экрана, 2018-06-16 11-16-51.png
2018-06-16 10:29 Anton Kavalenka File Added: dashes.diff
2018-06-16 10:29 Anton Kavalenka Note Added: 0108926
2019-06-11 09:42 CudaText man Note Added: 0116673
2019-06-12 08:38 Jesus Reyes Note Added: 0116682
2019-06-12 08:40 Jesus Reyes File Added: SinAnton.png
2019-06-12 08:40 Jesus Reyes File Added: conAnton.png
2019-06-12 08:43 Jesus Reyes File Added: TurboDelphi.png
2019-06-12 08:46 Jesus Reyes File Added: TurboDelphi_dots.png
2019-06-12 08:50 Jesus Reyes Note Edited: 0116682 View Revisions
2019-06-12 08:53 Jesus Reyes Relationship added related to 0035662
2019-06-12 17:29 Anton Kavalenka Note Added: 0116696
2019-06-12 21:09 Anton Kavalenka Note Added: 0116700
2019-06-12 21:09 Anton Kavalenka Note Edited: 0116700 View Revisions
2019-06-13 18:43 Jesus Reyes Assigned To => Jesus Reyes
2019-06-13 18:43 Jesus Reyes Status new => assigned
2019-06-13 19:12 Jesus Reyes Status assigned => resolved
2019-06-13 19:12 Jesus Reyes Resolution open => fixed
2019-06-13 19:12 Jesus Reyes Fixed in Version => 2.1 (SVN)
2019-06-13 19:12 Jesus Reyes Fixed in Revision => 61378
2019-06-13 19:12 Jesus Reyes LazTarget => 2.0.4
2019-06-13 19:12 Jesus Reyes Widgetset GTK 2 => GTK 2
2019-06-13 19:12 Jesus Reyes Note Added: 0116710
2019-06-13 19:58 Anton Kavalenka Note Added: 0116712
2019-06-15 15:23 Anton Kavalenka Status resolved => closed