version	U12.1.00
uid	clipping.u1-1786291392-0
impl	error
global	3
	0,000005,DrawClipped,-1
	1,000005,ClipLine,6
	2,000005,Coalesce,1

proc DrawClipped
	local	0,001000,a
	local	1,000020,win
	local	2,000000,type
	local	3,000000,pop
	local	4,000000,DrawSegment
	local	5,000000,push
	local	6,000000,ClipLine
	con	0,002000,1,1
	con	1,010000,6,167,151,156,144,157,167
	declend
	filen	clipping.icn
	line	37
	colm	11
	synt	any
	mark	L1
	line	40
	colm	4
	synt	ifelse
	mark	L2
	pnull
	var	2
	pnull
	var	0
	int	0
	line	40
	colm	13
	synt	any
	subsc
	line	40
	colm	11
	synt	any
	invoke	1
	str	1
	line	40
	colm	18
	synt	any
	lexeq
	unmark
	pnull
	var	1
	var	3
	var	0
	line	41
	colm	17
	synt	any
	invoke	1
	line	41
	colm	11
	synt	any
	asgn
	goto	L3
lab L2
	pnull
	var	1
	line	43
	colm	14
	synt	any
	keywd	window
	line	43
	colm	11
	synt	any
	asgn
lab L3
	line	40
	colm	4
	synt	endifelse
	unmark
lab L1
	mark	L4
	var	4
	var	5
	var	6
	var	1
	var	0
	line	45
	colm	31
	synt	any
	invoke	2
	var	1
	line	45
	colm	22
	synt	any
	invoke	2
	invoke	-1
	unmark
lab L4
	mark	L5
	mark	L6
	var	1
	line	46
	colm	4
	synt	any
	pret
lab L6
	synt	any
	pfail
	unmark
lab L5
	pnull
	line	47
	colm	1
	synt	any
	pfail
	end
proc ClipLine
	local	0,001000,win
	local	1,001000,L
	local	2,001000,x
	local	3,001000,y
	local	4,001000,w
	local	5,001000,h
	local	6,000020,i
	local	7,000020,ret
	local	8,000020,tin
	local	9,000020,tout
	local	10,000020,delx
	local	11,000020,dely
	local	12,000020,x0
	local	13,000020,x1
	local	14,000020,xmax
	local	15,000020,y0
	local	16,000020,y1
	local	17,000020,ymax
	local	18,000000,type
	local	19,000000,ClipLine
	local	20,000000,WAttrib
	local	21,000000,real
	local	22,000000,put
	con	0,010000,4,154,151,163,164
	con	1,010000,5,143,154,151,160,170
	con	2,010000,2,144,170
	con	3,010000,5,143,154,151,160,171
	con	4,010000,2,144,171
	con	5,010000,5,143,154,151,160,167
	con	6,010000,5,143,154,151,160,150
	con	7,002000,1,0
	con	8,002000,1,1
	con	9,002000,1,2
	con	10,002000,1,3
	con	11,004000,0.0
	con	12,004000,1.0
	declend
	line	55
	colm	11
	synt	any
	mark	L1
	line	58
	colm	4
	synt	if
	mark0
	pnull
	var	18
	var	0
	line	58
	colm	12
	synt	any
	invoke	1
	str	0
	line	58
	colm	18
	synt	any
	lexeq
	unmark
	mark	L2
	var	19
	line	59
	colm	23
	synt	any
	keywd	window
	var	0
	var	1
	var	2
	var	3
	var	4
	line	59
	colm	22
	synt	any
	invoke	6
	line	59
	colm	7
	synt	any
	pret
lab L2
	synt	any
	pfail
	line	58
	colm	4
	synt	endif
	unmark
lab L1
	mark	L3
	pnull
	pnull
	var	2
	line	61
	colm	4
	synt	any
	null
	pnull
	var	20
	var	0
	str	1
	line	61
	colm	17
	synt	any
	invoke	2
	var	20
	var	0
	str	2
	line	61
	colm	41
	synt	any
	invoke	2
	line	61
	colm	32
	synt	any
	minus
	line	61
	colm	7
	synt	any
	asgn
	unmark
lab L3
	mark	L4
	pnull
	pnull
	var	3
	line	62
	colm	4
	synt	any
	null
	pnull
	var	20
	var	0
	str	3
	line	62
	colm	17
	synt	any
	invoke	2
	var	20
	var	0
	str	4
	line	62
	colm	41
	synt	any
	invoke	2
	line	62
	colm	32
	synt	any
	minus
	line	62
	colm	7
	synt	any
	asgn
	unmark
lab L4
	mark	L5
	pnull
	pnull
	var	4
	line	63
	colm	4
	synt	any
	null
	var	20
	var	0
	str	5
	line	63
	colm	17
	synt	any
	invoke	2
	line	63
	colm	7
	synt	any
	asgn
	unmark
lab L5
	mark	L6
	pnull
	pnull
	var	5
	line	64
	colm	4
	synt	any
	null
	var	20
	var	0
	str	6
	line	64
	colm	17
	synt	any
	invoke	2
	line	64
	colm	7
	synt	any
	asgn
	unmark
lab L6
	mark	L7
	line	65
	colm	4
	synt	if
	mark0
	pnull
	var	4
	int	7
	line	65
	colm	9
	synt	any
	numlt
	unmark
	pnull
	var	2
	dup
	pnull
	var	4
	pnull
	var	4
	line	66
	colm	19
	synt	any
	neg
	line	66
	colm	16
	synt	any
	asgn
	line	66
	colm	9
	synt	any
	minus
	asgn
	line	65
	colm	4
	synt	endif
	unmark
lab L7
	mark	L8
	line	67
	colm	4
	synt	if
	mark0
	pnull
	var	5
	int	7
	line	67
	colm	9
	synt	any
	numlt
	unmark
	pnull
	var	3
	dup
	pnull
	var	5
	pnull
	var	5
	line	68
	colm	19
	synt	any
	neg
	line	68
	colm	16
	synt	any
	asgn
	line	68
	colm	9
	synt	any
	minus
	asgn
	line	67
	colm	4
	synt	endif
	unmark
lab L8
	mark	L9
	pnull
	var	14
	pnull
	var	2
	var	4
	line	69
	colm	14
	synt	any
	plus
	line	69
	colm	9
	synt	any
	asgn
	unmark
lab L9
	mark	L10
	pnull
	var	17
	pnull
	var	3
	var	5
	line	70
	colm	14
	synt	any
	plus
	line	70
	colm	9
	synt	any
	asgn
	unmark
lab L10
	mark	L11
	pnull
	var	7
	pnull
	line	72
	colm	11
	synt	any
	llist	0
	line	72
	colm	8
	synt	any
	asgn
	unmark
lab L11
	mark	L12
	pnull
	var	13
	pnull
	var	1
	int	8
	line	73
	colm	11
	synt	any
	subsc
	line	73
	colm	7
	synt	any
	asgn
	unmark
lab L12
	mark	L13
	pnull
	var	16
	pnull
	var	1
	int	9
	line	74
	colm	11
	synt	any
	subsc
	line	74
	colm	7
	synt	any
	asgn
	unmark
lab L13
	mark	L14
	line	76
	colm	4
	synt	every
	mark0
	pnull
	var	6
	pnull
	int	10
	pnull
	var	1
	line	76
	colm	20
	synt	any
	size
	int	9
	line	76
	colm	17
	synt	any
	toby
	line	76
	colm	12
	synt	any
	asgn
	pop
	mark0
	mark	L17
	pnull
	var	12
	var	13
	line	77
	colm	10
	synt	any
	asgn
	unmark
lab L17
	mark	L18
	pnull
	var	15
	var	16
	line	78
	colm	10
	synt	any
	asgn
	unmark
lab L18
	mark	L19
	pnull
	var	13
	pnull
	var	1
	var	6
	line	79
	colm	14
	synt	any
	subsc
	line	79
	colm	10
	synt	any
	asgn
	unmark
lab L19
	mark	L20
	pnull
	var	16
	pnull
	var	1
	pnull
	var	6
	int	8
	line	80
	colm	17
	synt	any
	plus
	line	80
	colm	14
	synt	any
	subsc
	line	80
	colm	10
	synt	any
	asgn
	unmark
lab L20
	mark	L21
	pnull
	var	8
	real	11
	line	81
	colm	11
	synt	any
	asgn
	unmark
lab L21
	mark	L22
	pnull
	var	9
	real	12
	line	82
	colm	12
	synt	any
	asgn
	unmark
lab L22
	mark	L23
	pnull
	var	10
	var	21
	pnull
	var	13
	var	12
	line	84
	colm	23
	synt	any
	minus
	line	84
	colm	19
	synt	any
	invoke	1
	line	84
	colm	12
	synt	any
	asgn
	unmark
lab L23
	mark	L24
	line	85
	colm	7
	synt	ifelse
	mark	L25
	pnull
	var	10
	real	11
	line	85
	colm	15
	synt	any
	numlt
	unmark
	mark	L27
	pnull
	var	8
	dup
	pnull
	pnull
	var	14
	var	12
	line	86
	colm	24
	synt	any
	minus
	var	10
	line	86
	colm	30
	synt	any
	div
	line	86
	colm	14
	synt	any
	numlt
	asgn
	unmark
lab L27
	pnull
	var	9
	dup
	pnull
	pnull
	var	2
	var	12
	line	87
	colm	22
	synt	any
	minus
	var	10
	line	87
	colm	28
	synt	any
	div
	line	87
	colm	15
	synt	any
	numgt
	asgn
	goto	L26
lab L25
	line	89
	colm	12
	synt	ifelse
	mark	L28
	pnull
	var	10
	real	11
	line	89
	colm	20
	synt	any
	numgt
	unmark
	mark	L30
	pnull
	var	8
	dup
	pnull
	pnull
	var	2
	var	12
	line	90
	colm	21
	synt	any
	minus
	var	10
	line	90
	colm	27
	synt	any
	div
	line	90
	colm	14
	synt	any
	numlt
	asgn
	unmark
lab L30
	pnull
	var	9
	dup
	pnull
	pnull
	var	14
	var	12
	line	91
	colm	25
	synt	any
	minus
	var	10
	line	91
	colm	31
	synt	any
	div
	line	91
	colm	15
	synt	any
	numgt
	asgn
	goto	L29
lab L28
	mark	L31
	pnull
	pnull
	var	2
	var	12
	line	94
	colm	12
	synt	any
	numle
	var	14
	line	94
	colm	18
	synt	any
	numle
	line	94
	colm	26
	synt	any
	esusp
	goto	L32
lab L31
	unmark
	unmark
	goto	L15
lab L32
lab L29
	line	89
	colm	12
	synt	endifelse
lab L26
	line	85
	colm	7
	synt	endifelse
	unmark
lab L24
	mark	L33
	line	95
	colm	7
	synt	if
	mark0
	pnull
	var	9
	var	8
	line	95
	colm	15
	synt	any
	numlt
	unmark
	unmark
	unmark
	goto	L15
	line	95
	colm	7
	synt	endif
	unmark
lab L33
	mark	L34
	pnull
	var	11
	var	21
	pnull
	var	16
	var	15
	line	97
	colm	23
	synt	any
	minus
	line	97
	colm	19
	synt	any
	invoke	1
	line	97
	colm	12
	synt	any
	asgn
	unmark
lab L34
	mark	L35
	line	98
	colm	7
	synt	ifelse
	mark	L36
	pnull
	var	11
	real	11
	line	98
	colm	15
	synt	any
	numlt
	unmark
	mark	L38
	pnull
	var	8
	dup
	pnull
	pnull
	var	17
	var	15
	line	99
	colm	24
	synt	any
	minus
	var	11
	line	99
	colm	30
	synt	any
	div
	line	99
	colm	14
	synt	any
	numlt
	asgn
	unmark
lab L38
	pnull
	var	9
	dup
	pnull
	pnull
	var	3
	var	15
	line	100
	colm	22
	synt	any
	minus
	var	11
	line	100
	colm	28
	synt	any
	div
	line	100
	colm	15
	synt	any
	numgt
	asgn
	goto	L37
lab L36
	line	102
	colm	12
	synt	ifelse
	mark	L39
	pnull
	var	11
	real	11
	line	102
	colm	20
	synt	any
	numgt
	unmark
	mark	L41
	pnull
	var	8
	dup
	pnull
	pnull
	var	3
	var	15
	line	103
	colm	21
	synt	any
	minus
	var	11
	line	103
	colm	27
	synt	any
	div
	line	103
	colm	14
	synt	any
	numlt
	asgn
	unmark
lab L41
	pnull
	var	9
	dup
	pnull
	pnull
	var	17
	var	15
	line	104
	colm	25
	synt	any
	minus
	var	11
	line	104
	colm	31
	synt	any
	div
	line	104
	colm	15
	synt	any
	numgt
	asgn
	goto	L40
lab L39
	mark	L42
	pnull
	pnull
	var	3
	var	15
	line	107
	colm	12
	synt	any
	numle
	var	17
	line	107
	colm	18
	synt	any
	numle
	line	107
	colm	26
	synt	any
	esusp
	goto	L43
lab L42
	unmark
	unmark
	goto	L15
lab L43
lab L40
	line	102
	colm	12
	synt	endifelse
lab L37
	line	98
	colm	7
	synt	endifelse
	unmark
lab L35
	mark	L44
	line	108
	colm	7
	synt	if
	mark0
	pnull
	var	9
	var	8
	line	108
	colm	15
	synt	any
	numlt
	unmark
	unmark
	unmark
	goto	L15
	line	108
	colm	7
	synt	endif
	unmark
lab L44
	var	22
	var	7
	pnull
	var	12
	pnull
	var	8
	var	10
	line	110
	colm	24
	synt	any
	mult
	line	110
	colm	19
	synt	any
	plus
	pnull
	var	15
	pnull
	var	8
	var	11
	line	110
	colm	39
	synt	any
	mult
	line	110
	colm	34
	synt	any
	plus
	pnull
	var	12
	pnull
	var	9
	var	10
	line	110
	colm	55
	synt	any
	mult
	line	110
	colm	49
	synt	any
	plus
	pnull
	var	15
	pnull
	var	9
	var	11
	line	110
	colm	71
	synt	any
	mult
	line	110
	colm	65
	synt	any
	plus
	line	110
	colm	10
	synt	any
	invoke	5
	unmark
lab L15
	efail
lab L16
	line	76
	colm	4
	synt	endevery
	unmark
lab L14
	mark	L45
	line	113
	colm	4
	synt	ifelse
	mark	L46
	pnull
	pnull
	var	7
	line	113
	colm	7
	synt	any
	size
	int	7
	line	113
	colm	12
	synt	any
	numgt
	unmark
	mark	L48
	var	7
	line	114
	colm	7
	synt	any
	pret
lab L48
	synt	any
	pfail
	goto	L47
lab L46
	line	116
	colm	7
	synt	any
	pfail
lab L47
	line	113
	colm	4
	synt	endifelse
	unmark
lab L45
	pnull
	line	117
	colm	1
	synt	any
	pfail
	end
proc Coalesce
	local	0,001000,L
	local	1,000020,i
	local	2,000020,all
	local	3,000020,seg
	local	4,000020,x1
	local	5,000020,y1
	local	6,000020,x2
	local	7,000020,y2
	local	8,000000,put
	con	0,002000,1,1
	con	1,002000,1,4
	con	2,002000,1,2
	con	3,002000,1,3
	declend
	line	122
	colm	11
	synt	any
	mark	L1
	pnull
	var	2
	pnull
	line	125
	colm	11
	synt	any
	llist	0
	line	125
	colm	8
	synt	any
	asgn
	unmark
lab L1
	mark	L2
	line	126
	colm	4
	synt	every
	mark0
	pnull
	var	1
	pnull
	int	0
	pnull
	var	0
	line	126
	colm	20
	synt	any
	size
	int	1
	line	126
	colm	17
	synt	any
	toby
	line	126
	colm	12
	synt	any
	asgn
	pop
	mark0
	mark	L5
	pnull
	var	4
	pnull
	var	0
	var	1
	line	127
	colm	14
	synt	any
	subsc
	line	127
	colm	10
	synt	any
	asgn
	unmark
lab L5
	mark	L6
	pnull
	var	5
	pnull
	var	0
	pnull
	var	1
	int	0
	line	128
	colm	17
	synt	any
	plus
	line	128
	colm	14
	synt	any
	subsc
	line	128
	colm	10
	synt	any
	asgn
	unmark
lab L6
	mark	L7
	line	129
	colm	7
	synt	if
	mark0
	mark	L8
	pnull
	var	4
	var	6
	line	129
	colm	13
	synt	any
	neqv
	line	129
	colm	21
	synt	any
	esusp
	goto	L9
lab L8
	pnull
	var	5
	var	7
	line	129
	colm	26
	synt	any
	neqv
lab L9
	unmark
	var	8
	var	2
	pnull
	var	3
	pnull
	var	4
	var	5
	line	130
	colm	26
	synt	any
	llist	2
	line	130
	colm	23
	synt	any
	asgn
	line	130
	colm	13
	synt	any
	invoke	2
	line	129
	colm	7
	synt	endif
	unmark
lab L7
	var	8
	var	3
	pnull
	var	6
	pnull
	var	0
	pnull
	var	1
	int	2
	line	131
	colm	26
	synt	any
	plus
	line	131
	colm	23
	synt	any
	subsc
	line	131
	colm	19
	synt	any
	asgn
	pnull
	var	7
	pnull
	var	0
	pnull
	var	1
	int	3
	line	131
	colm	42
	synt	any
	plus
	line	131
	colm	39
	synt	any
	subsc
	line	131
	colm	35
	synt	any
	asgn
	line	131
	colm	10
	synt	any
	invoke	3
	unmark
lab L3
	efail
lab L4
	line	126
	colm	4
	synt	endevery
	unmark
lab L2
	mark	L10
	mark	L11
	var	2
	line	134
	colm	4
	synt	any
	pret
lab L11
	synt	any
	pfail
	unmark
lab L10
	pnull
	line	135
	colm	1
	synt	any
	pfail
	end
