This commit adds support for linked axes between plots. One can specify
such linked limits using the new `linked_x_axis()` function (and the
variants for the Y axes) by specifying an `Rc<RefCell<ImPlotRange>>`
value, and passing clones of the same `Rc` to other plots.
The values within those `Rc` need to be kept persistent between frames,
hence the way to use this functionality is to keep a clone of the `Rc`
outside the frame-drawing function as part of the application state.
The regular limit setting API is unaffected.
- This commit also fixes an issue with legend rotation and orientation
always being set to values even if the user did not specify any.
This broke the interactive configuration of where the legend should
be.
- This updates the bindings generator, the low-level bindings as
well as the higher-level bindings and the examples to work
with a newer master of cimplot that links to implot 0.7.
- Several things are not done properly yet:
- Contexts can be created and as long as they are not dropped
things work out (shown in the examples). However, this should
be done more imgui-rs like, where operations that require a context
make that explicit by requiring a context reference to be passed.
- The README has not been updated yet to all the new features that
were added.
- Also exposed the sys crate's ImPlotRange, ImPlotLimits and ImPlotPoint
to the user as well as changing the limit-setting interface to using
those. I'm not super sure about doing this yet though, because it is
more verbose for no real reason to the user and for the purposes of
the abstraction it may be better to add facade types anyway.
- There is no protection against calling things like `is_hovered` from
outside a plot. Will need to think about how to make this impossible
by design - we could for example pass an object to Plot's closure
that has these methods, and that object is not created anywhere
else.
- Copied the trick from imgui-rs to notice if a begin() is left
unmatched
- Changed plot_line to be a struct, but might go away from that
again. Initial idea was to add things like setting markers and
colors to this as struct methods, but it seems this will lead
to lots of code overhead compared to the pushing and popping
stylevars approach taken in the C++ implementation.