Page MenuHome

Refactor View2D number drawing
ClosedPublic

Authored by Jacques Lucke (JacquesLucke) on Apr 14 2019, 3:30 PM.

Details

Summary

The main goal of this refactor is to separate drawing the frame numbers from drawing the scrollbar in the timeline.
This is necessary for T63193.

Furthermore, this patch changes/fixes the position of some scale indicators in the UI.

Before:

After:

Simple test to see that I can draw frame numbers into arbitrary rectangles in the region now (not part of the patch):

Individual commits:

  • move horizontal numbers drawing into separate function
  • move vertical number drawing to separate function
  • move declarations closer to first use
  • improve variable naming
  • use correct distance between numbers
  • use correct start x location
  • make number drawing independent of scrollers
  • remove unused view2d units
  • move variable definitions closer to their first use
  • use less generic method for actually drawing the text
  • draw text centered on grid lines
  • fix text used for seconds
  • separate vertical number drawing from scroller and position text correctly
  • "better" special case for the sequencer
  • only display text in a rectangle
  • cleanup display-twice-avoidance
  • rename "power" to "brevity_level"
  • turn grid number drawing into api functions

Diff Detail

Repository
rB Blender

Event Timeline

  • split xpos in xpos and initial_xpos, same for ypos

Great! This looks like it is way more accurate than before.

This revision is now accepted and ready to land.Apr 16 2019, 12:18 AM
This revision was automatically updated to reflect the committed changes.