Conversation
|
It looks like |
This is surprising! It looks like the command It looks like I fixed it: I ran Note to self: setting up the auto-formatter is discussed in #425: |
Application.DoEventsI like your Resize() in MatchAxis()The intended purpose of Resize() was to match the layout (padding and tick density), not just axis limits. A changed layout means new bitmaps, so this is necessary when the source layout changes. This is what it looks when you zoom out really far on the top graph: However, the invention of an improved layout system #156 meant that Big PictureScottPlot has evolved so much over the last year that its architecture drifted from what the original user controls had in mind when they were designed. This is a topic for another discussion, but my point is there is much room for improvement by refactoring how ScottPlot handles bitmaps (e.g., they should not be stored or resized, IDisposable objects should be better respected, and using separate Bitmaps for the frame vs. data is a bad idea). I plan to improve these things incrementally, but hopefully there will be more time when active issues/PRs slow down again. |
This was the original intent of calling Resize(), as a long time ago Resize() performed the function of layout tightening. This modification not only improves functionality, but is more expressive. ScottPlot#452

Purpose:
Fix linked axes lagging. #451
The reasone is full
Render()loop in secondformsPloton each mouse move.This PR add
skipIfCurrentRendered = trueto demo,Add extra param to
Render(bool processEvents). This param allow to makeApplication.DoEvents()inRender()for not interactive formsPlot (no mouse pan on zoom).Resize()inMatchAxis()was commented. I have no idea why it was implemented in this method, But it create new bitmaps for all layers on eachMatchAxis()call.//TODO
Demo contain not optimal render call in
formsPlot2.AxisChanged().This is for demonstration benefits of this PR. It must be changed to optimal before merge.
New functionality (code):
Extra parameter in
Render()to process events in not interactedformsPlot.Combined with
skipIfCurrentlyRendered=truethis allow multiple Render calls without lagging for not interactiveformsPlots. This param may be usefull not only for linked axes plots.New functionality (image):
Linked Axes demo demonstrates this PR.
Interactions on upper
formsPlot1contain this PR changes.Interactions on lower
formsPlot2use old implementation.