fix-right-chunk ( left right ymin ymax -- right' )


Vocabulary
ui.gadgets.charts.lines.private

Inputs
leftan object
rightan object
yminan object
ymaxan object


Outputs
right'an object


Definition


:: 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 ;