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


Vocabulary
ui.gadgets.charts.lines.private

Inputs
leftan object
rightan object
yminan object
ymaxan object


Outputs
left'an object


Definition


:: fix-left-chunk ( left right ymin ymax -- left' )
left last :> left-point right first :> right-point
left-point y right-point y {
[ { [ drop ymin = ] [ > ] } 2&& ]
[ { [ drop ymax = ] [ < ] } 2&& ]
} 2||
[ left ] [
left-point y right-point y > ymin ymax ?
:> y-coord left-point x right-point x =
[ left-point x y-coord 2array ] [
left-point right-point calc-line-slope
y-coord left-point calc-point-y
] if left swap suffix
] if ;