Cleanup: refactor VSE timeline drawing code

- Use context variables for drawing functions.
- Move conditions to functions drawing specific elements as
  preconditions
- Disentangle calculation of common coordinates.
- Use more descriptive variable names (in context at least)

Individual drawing functions are mostly unchanged, so improvements there
are minimal.

No intended functional changes.
This commit is contained in:
Richard Antalik
2023-09-09 15:20:17 +02:00
parent dd515ebc1d
commit 4d668e6825
2 changed files with 587 additions and 495 deletions
@@ -435,6 +435,14 @@ void draw_seq_strip_thumbnail(View2D *v2d,
float pixelx,
float pixely)
{
SpaceSeq *sseq = CTX_wm_space_seq(C);
if ((sseq->flag & SEQ_SHOW_OVERLAY) == 0 ||
(sseq->timeline_overlay.flag & SEQ_TIMELINE_SHOW_THUMBNAILS) == 0 ||
!ELEM(seq->type, SEQ_TYPE_MOVIE, SEQ_TYPE_IMAGE))
{
return;
}
bool clipped = false;
float image_height, image_width, thumb_width;
rcti crop;
File diff suppressed because it is too large Load Diff