mirror of
https://github.com/Drezil/dear-implot.hs.git
synced 2024-12-27 01:56:36 +00:00
Add setNextPlotLimits
This commit is contained in:
parent
9845f2042a
commit
bb1bb02e1c
@ -47,3 +47,12 @@ plotLine desc xs ys = liftIO $ do
|
||||
withArray (map realToFrac xs) \xsPtr -> do
|
||||
withArray (map realToFrac ys) \ysPtr -> do
|
||||
[C.exp| void { PlotLine( $(char* descPtr), $(float *xsPtr), $(float *ysPtr), $(int size) ) } |]
|
||||
|
||||
setNextPlotLimits :: MonadIO m => (Double, Double) -> (Double, Double) -> m ()
|
||||
setNextPlotLimits (minX, maxX) (minY, maxY) =
|
||||
liftIO [C.exp| void { SetNextPlotLimits( $(double minX'), $(double maxX'), $(double minY'), $(double maxY') ) } |]
|
||||
where
|
||||
minX' = realToFrac minX
|
||||
maxX' = realToFrac maxX
|
||||
minY' = realToFrac minY
|
||||
maxY' = realToFrac maxY
|
||||
|
Loading…
Reference in New Issue
Block a user