Handbook
Glossary
fix-right-chunk ( left right ymin ymax -- right' )
Vocabulary
ui
.
gadgets
.
charts
.
lines
.
private
Inputs
left
an
object
right
an
object
ymin
an
object
ymax
an
object
Outputs
right'
an
object
Definition
USING:
arrays
combinators.short-circuit
kernel
math
sequences
;
IN:
ui.gadgets.charts.lines.private
::
fix-right-chunk
( left right ymin ymax -- right' )
left
last
:>
left-point right
first
:>
right-point
left-point
y
right-point
y
{
[
{
[
ymin
=
nip
]
[
<
]
}
2&&
]
[
{
[
ymax
=
nip
]
[
>
]
}
2&&
]
}
2||
[
right
]
[
left-point
y
right-point
y
<
ymin ymax
?
:>
y-coord left-point
x
right-point
x
=
[
right-point
x
y-coord
2array
]
[
left-point right-point
calc-line-slope
y-coord left-point
calc-point-y
]
if
right
swap
prefix
]
if
;