View Issue Details

IDProjectCategoryView StatusLast Update
0035760FPCRTLpublic2019-07-05 18:26
ReporterBloodbatgotAssigned ToSven Barth 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformPCOSWindowsOS Version10
Product Version3.0.4Product Build 
Target VersionFixed in Version3.3.1 
Summary0035760: Graph unit's lines are drawn wrong when line style is ThickWidth
DescriptionWhen drawing lines using the graph unit and using SetLineStyle(SolidLn, 0, ThickWidth) lines are either drawn incomplete (the bottom pixels begin drawing at the last pixel) or are "leaking" on the right side, this also happens for the go32v2 target and have tested under Windows 7 as well. Turbo Pascal draws such lines properly. (I have attached graphics from GO32V2, Win32 and a TP compiled version).
Steps To ReproduceCreate a simple program, use the graph unit, init graphics, change line style with SetLineStyle(SolidLn, 0, ThickWidth) and use Line to draw a line anywhere. A sample program is attached.
TagsNo tags attached.
Fixed in Revision42327
FPCOldBugId
FPCTarget-
Attached Files
  • go32v2.png (1,330 bytes)
    go32v2.png (1,330 bytes)
  • win32.png (2,259 bytes)
    win32.png (2,259 bytes)
  • turbo.png (1,226 bytes)
    turbo.png (1,226 bytes)
  • grphtest.pas (662 bytes)
    program grphtest;
    
    {$IFDEF FPC}
    {$MODE TP}
    {$ENDIF}
    
    uses
      Graph,
      Crt {$IFDEF WIN32},
      WinCRT {$ENDIF};
    
    const
      Msg = 'Press any key';
    
    var
      GDriver: integer;
      GMode: integer;
      XPos: integer;
      YPos: integer;
    
    begin
      {$IFNDEF FPC}
      GDriver := Detect;
      GMode := 0;
      {$ELSE}
      GDriver := D8bit;
      GMode := m640x480;
      {$ENDIF}
      InitGraph(GDriver, GMode, '');
      SetLineStyle(SolidLn, 0, ThickWidth);
      XPos := GetMaxX div 2 - 100 div 2;
      YPos := GetMaxY div 2 - 1;
      Line(XPos, YPos, XPos + 100, YPos);
      OutTextXY(GetMaxX - TextWidth(Msg) - 10, GetMaxY - TextHeight(Msg) - 10, Msg);
      Readkey;
      CloseGraph;
    end.
    
    grphtest.pas (662 bytes)
  • graph.inc.patch (612 bytes)
    Index: packages/graph/src/inc/graph.inc
    ===================================================================
    diff --git a/branches/fixes_3_0/packages/graph/src/inc/graph.inc b/branches/fixes_3_0/packages/graph/src/inc/graph.inc
    --- a/branches/fixes_3_0/packages/graph/src/inc/graph.inc	(revision 42321)
    +++ b/branches/fixes_3_0/packages/graph/src/inc/graph.inc	(working copy)
    @@ -261,7 +261,7 @@
                    { thick width }
                    hline(x1,x2,y2-1);
                    hline(x1,x2,y2);
    -               hline(x2,x2,y2+1);
    +               hline(x1,x2,y2+1);
                 end;
             end
         else
    
    graph.inc.patch (612 bytes)

Activities

Bloodbatgot

2019-06-24 19:01

reporter  

go32v2.png (1,330 bytes)
go32v2.png (1,330 bytes)
win32.png (2,259 bytes)
win32.png (2,259 bytes)
turbo.png (1,226 bytes)
turbo.png (1,226 bytes)
grphtest.pas (662 bytes)
program grphtest;

{$IFDEF FPC}
{$MODE TP}
{$ENDIF}

uses
  Graph,
  Crt {$IFDEF WIN32},
  WinCRT {$ENDIF};

const
  Msg = 'Press any key';

var
  GDriver: integer;
  GMode: integer;
  XPos: integer;
  YPos: integer;

begin
  {$IFNDEF FPC}
  GDriver := Detect;
  GMode := 0;
  {$ELSE}
  GDriver := D8bit;
  GMode := m640x480;
  {$ENDIF}
  InitGraph(GDriver, GMode, '');
  SetLineStyle(SolidLn, 0, ThickWidth);
  XPos := GetMaxX div 2 - 100 div 2;
  YPos := GetMaxY div 2 - 1;
  Line(XPos, YPos, XPos + 100, YPos);
  OutTextXY(GetMaxX - TextWidth(Msg) - 10, GetMaxY - TextHeight(Msg) - 10, Msg);
  Readkey;
  CloseGraph;
end.
grphtest.pas (662 bytes)

Bloodbatgot

2019-07-03 11:58

reporter   ~0117044

Fix for the error in this report.

graph.inc.patch (612 bytes)
Index: packages/graph/src/inc/graph.inc
===================================================================
diff --git a/branches/fixes_3_0/packages/graph/src/inc/graph.inc b/branches/fixes_3_0/packages/graph/src/inc/graph.inc
--- a/branches/fixes_3_0/packages/graph/src/inc/graph.inc	(revision 42321)
+++ b/branches/fixes_3_0/packages/graph/src/inc/graph.inc	(working copy)
@@ -261,7 +261,7 @@
                { thick width }
                hline(x1,x2,y2-1);
                hline(x1,x2,y2);
-               hline(x2,x2,y2+1);
+               hline(x1,x2,y2+1);
             end;
         end
     else
graph.inc.patch (612 bytes)

Sven Barth

2019-07-05 14:41

manager   ~0117081

Thank you for the patch. Please test and close if okay

Bloodbatgot

2019-07-05 18:26

reporter   ~0117088

Fixed.

Issue History

Date Modified Username Field Change
2019-06-24 19:01 Bloodbatgot New Issue
2019-06-24 19:01 Bloodbatgot File Added: go32v2.png
2019-06-24 19:01 Bloodbatgot File Added: win32.png
2019-06-24 19:01 Bloodbatgot File Added: turbo.png
2019-06-24 19:01 Bloodbatgot File Added: grphtest.pas
2019-07-03 11:58 Bloodbatgot File Added: graph.inc.patch
2019-07-03 11:58 Bloodbatgot Note Added: 0117044
2019-07-05 14:41 Sven Barth Assigned To => Sven Barth
2019-07-05 14:41 Sven Barth Status new => resolved
2019-07-05 14:41 Sven Barth Resolution open => fixed
2019-07-05 14:41 Sven Barth Fixed in Version => 3.3.1
2019-07-05 14:41 Sven Barth Fixed in Revision => 42327
2019-07-05 14:41 Sven Barth FPCTarget => -
2019-07-05 14:41 Sven Barth Note Added: 0117081
2019-07-05 18:26 Bloodbatgot Status resolved => closed
2019-07-05 18:26 Bloodbatgot Note Added: 0117088