mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-23 00:18:51 +02:00
* fixed Rectangle, Bar and Bar3D for the cases when x1>x2 or y1>y2
git-svn-id: trunk@15874 -
This commit is contained in:
parent
db2d55128c
commit
aa1b3a6542
@ -896,8 +896,21 @@ var
|
|||||||
|
|
||||||
|
|
||||||
procedure Rectangle(x1,y1,x2,y2:smallint);
|
procedure Rectangle(x1,y1,x2,y2:smallint);
|
||||||
|
var
|
||||||
|
tmp: smallint;
|
||||||
begin
|
begin
|
||||||
|
if x1 > x2 then
|
||||||
|
begin
|
||||||
|
tmp := x1;
|
||||||
|
x1 := x2;
|
||||||
|
x2 := tmp;
|
||||||
|
end;
|
||||||
|
if y1 > y2 then
|
||||||
|
begin
|
||||||
|
tmp := y1;
|
||||||
|
y1 := y2;
|
||||||
|
y2 := tmp;
|
||||||
|
end;
|
||||||
{ Do not draw the end points }
|
{ Do not draw the end points }
|
||||||
Line(x1,y1,x2-1,y1);
|
Line(x1,y1,x2-1,y1);
|
||||||
Line(x1,y1+1,x1,y2);
|
Line(x1,y1+1,x1,y2);
|
||||||
@ -1561,6 +1574,12 @@ end;
|
|||||||
y1:=y2;
|
y1:=y2;
|
||||||
y2:=y;
|
y2:=y;
|
||||||
end;
|
end;
|
||||||
|
if x1>x2 then
|
||||||
|
begin
|
||||||
|
y:=x1;
|
||||||
|
x1:=x2;
|
||||||
|
x2:=y;
|
||||||
|
end;
|
||||||
|
|
||||||
{ Always copy mode for Bars }
|
{ Always copy mode for Bars }
|
||||||
origwritemode := CurrentWriteMode;
|
origwritemode := CurrentWriteMode;
|
||||||
@ -1603,6 +1622,19 @@ var
|
|||||||
origwritemode : smallint;
|
origwritemode : smallint;
|
||||||
OldX, OldY : smallint;
|
OldX, OldY : smallint;
|
||||||
begin
|
begin
|
||||||
|
if x1 > x2 then
|
||||||
|
begin
|
||||||
|
OldX := x1;
|
||||||
|
x1 := x2;
|
||||||
|
x2 := OldX;
|
||||||
|
end;
|
||||||
|
if y1 > y2 then
|
||||||
|
begin
|
||||||
|
OldY := y1;
|
||||||
|
y1 := y2;
|
||||||
|
y2 := OldY;
|
||||||
|
end;
|
||||||
|
|
||||||
origwritemode := CurrentWriteMode;
|
origwritemode := CurrentWriteMode;
|
||||||
CurrentWriteMode := CopyPut;
|
CurrentWriteMode := CopyPut;
|
||||||
Bar(x1,y1,x2,y2);
|
Bar(x1,y1,x2,y2);
|
||||||
|
Loading…
Reference in New Issue
Block a user