Page MenuHome

Refactor grid and scale indicator text drawing
ClosedPublic

Authored by Jacques Lucke (JacquesLucke) on May 1 2019, 5:46 PM.

Details

Summary

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 only compose some shared
low level functions.

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.

@William Reynish (billreynish), can you please test of there are any regressions?

Diff Detail

Repository
rB Blender

Event Timeline

I didn't test for regressions, but overall code structure looks fine.

This revision is now accepted and ready to land.May 1 2019, 6:22 PM

Tested briefly. Seems like the grid display works.

This revision was automatically updated to reflect the committed changes.