Refactor grid and scale indicator text drawing

This affects the timeline, dopesheet, graph editor, sequencer,
clip editor and nla editor.

Removed structs and enums: `V2D_ARG_DUMMY`, `eView2D_Units`,
`eView2D_Clamp`, `eView2D_Gridlines`, `View2DGrid`.

A main goal of this refactor is to get rid of the very generic
`View2DGrid` struct. The drawing code became very complex
because there were many different combinations of settings.

This refactor implements a different approach.
Instead of one very generic API, there are many slighly
different functions that do exactly, what we need in the
different editors. Only very little code is duplicated,
because the API functions compose some shared low level code.

This structure makes the code much easier to debug and change,
because every function has much fewer responsibilities.

Additionally, this refactor fixes some long standing bugs.
E.g. when `Show Seconds` is enabled, you zoom in and pan the view.
Or that the step size between displayed frame numbers was
always `>= 2`, no matter how close you zoom in.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D4776
This commit is contained in:
2019-05-02 12:00:12 +02:00
parent 5b14b56542
commit 667af6cf41
13 changed files with 617 additions and 627 deletions

View File

@@ -28,7 +28,6 @@ struct ARegion;
struct ARegionType;
struct ScrArea;
struct SpaceGraph;
struct View2DGrid;
struct bAnimContext;
struct bAnimListElem;
struct bContext;
@@ -42,7 +41,6 @@ void graph_draw_channel_names(struct bContext *C, struct bAnimContext *ac, struc
void graph_draw_curves(struct bAnimContext *ac,
struct SpaceGraph *sipo,
struct ARegion *ar,
struct View2DGrid *grid,
short sel);
void graph_draw_ghost_curves(struct bAnimContext *ac, struct SpaceGraph *sipo, struct ARegion *ar);