        SUBROUTINE GSDRW3(X0,Y0,X1,Y1)
        IMPLICIT NONE
C
C        DRAW A LINE FROM (X0,Y0) TO (X1,Y1) IN ABSOLUTE COORDINATES.
C        ASSUMES THAT CLIPPING HAS ALREADY BEEN DONE.   TO SUPPRESS UNNECESSA
C        "MOVES", THIS IS THE ONLY ROUTINE THAT SHOULD CALL GSDRVR(3,,,).
C        THE LINE IS DRAWN IN THE CURRENT LINE TYPE.   THIS ROUTINE DOES NOT
C        SET THE ABSOLUTE POSITION (XAPOS,YAPOS).   IT IS UP TO THE CALLER TO
C        DO SO IF NECESSARY.
C
        INCLUDE DIGLIB$KOM:GCLTYP.PRM

        REAL*4 X0,Y0,X1,Y1,DX,DY,DL,S
	INTEGER*1 IAND, IVAL
	EXTERNAL IAND
C
D	WRITE(9,2134)X0,Y0,X1,Y1
D2134	FORMAT("GSDRW3",4(F10.3,1X))

        IF (ILNTYP .GT. 1) GO TO 50
        IF (.NOT. LPOSND) CALL GSDRVR(3,X0,Y0)
        GO TO 220
C
C       SEGMENT LINE TO MAKE CURRENT LINE TYPE
C
50      CONTINUE
D	WRITE(9,2137)LINILT
D2137	FORMAT("LINILT",L6)
        IF (.NOT. LINILT) GO TO 100
        INXTL = 1
        DLEFT = DIST(1,ILNTYP-1)
        LINILT = .FALSE.
D	WRITE(9,2135)LINILT,INXTL,DLEFT,ILNTYP
D2135	FORMAT("LINILT,INXTL,DLEFT,ILNTYP",I4,1X,L6,1X,F10.3,1X,L6)
        IF (.NOT. LPOSND) CALL GSDRVR(3,X0,Y0)

100     CONTINUE
	DX = X1-X0
        DY = Y1-Y0
        DL = SQRT(DX**2+DY**2)
D	WRITE(9,2136)DX,DY
D2136	FORMAT(1X,"DX DY",2(F10.3,1X))
C
C       SEE IF THIS SEGMENT IS SHORTER THAT DIST. LEFT ON LINE TYPE
C
        IF (DL .LE. DLEFT) GO TO 200
C
C       SEGMENT IS LONGER, SO ADVANCE TO LINE TYPE BREAK
C
        S = DLEFT/DL
        X0 = S*DX+X0
        Y0 = S*DY+Y0
C
C       SEE IF THIS PART OF THE LINE TYPE IS DRAWN OR SKIPPED
C
C	IVAL = IAND(INXTL,1)
	IVAL = INXTL .AND. 1
D	WRITE(9,9898)IVAL,IVAL,INXTL,INXTL
D9898	FORMAT("IVAL IVAL INXTL INXTL",2(L6,I4));
        IF (IVAL .NE. 0) GO TO 120
                CALL GSDRVR(3,X0,Y0)
                GO TO 140
120         CONTINUE
                CALL GSDRVR(4,X0,Y0)
140     CONTINUE
C
C       NOW GO TO NEXT PORTION OF LINE TYPE
C
        INXTL = INXTL + 1
        IF (INXTL .GT. 4) INXTL = 1
        DLEFT = DIST(INXTL,ILNTYP-1)
        GO TO 100
C
C       DRAW LAST OF LINE IF DRAWN
C
200     CONTINUE
        DLEFT = DLEFT - DL
        IF (IAND(INXTL,1) .NE. 0) GO TO 220
                LPOSND = .FALSE.
                GO TO 240
220         CONTINUE
                CALL GSDRVR(4,X1,Y1)
                LPOSND = .TRUE.
240     CONTINUE
        RETURN
        END

