diff options
author | Joshua Leung <aligorith@gmail.com> | 2016-07-02 18:42:28 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2016-07-07 16:49:22 +0300 |
commit | 095c8dbe6919857ea322b213a1e240161cd7c843 (patch) | |
tree | 01a2ed133ae1a8bb898f0c24fb2d021f9a8dd888 /source/blender/editors/include/ED_anim_api.h | |
parent | fab4b907f6ba35f204fa25891024d1a2bdcaeda2 (diff) |
Dopesheet: Keyframe size can be adjusted as part of theme settings
This commit introduces a scale factor setting for scaling all keyframe indicators
in the Dopesheet Editor up/down, in order to make them easier to select. It is perhaps
most useful for keyframe types which are usually indicated using smaller keyframes
(e.g. breakdown), which may get tricky to quickly select.
Diffstat (limited to 'source/blender/editors/include/ED_anim_api.h')
-rw-r--r-- | source/blender/editors/include/ED_anim_api.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h index 27e1051a336..0940f594482 100644 --- a/source/blender/editors/include/ED_anim_api.h +++ b/source/blender/editors/include/ED_anim_api.h @@ -74,6 +74,7 @@ typedef struct bAnimContext { short mode; /* editor->mode */ short spacetype; /* sa->spacetype */ short regiontype; /* active region -> type (channels or main) */ + struct ScrArea *sa; /* editor host */ struct SpaceLink *sl; /* editor data */ struct ARegion *ar; /* region within editor */ @@ -85,6 +86,8 @@ typedef struct bAnimContext { ListBase *markers; /* active set of markers */ struct ReportList *reports; /* pointer to current reports list */ + + float yscale_fac; /* scale factor for height of channels (i.e. based on the size of keyframes) */ } bAnimContext; /* Main Data container types */ @@ -331,11 +334,11 @@ typedef enum eAnimFilter_Flags { /* -------------- Channel Defines -------------- */ /* channel heights */ -#define ACHANNEL_FIRST (-0.8f * U.widget_unit) -#define ACHANNEL_HEIGHT (0.8f * U.widget_unit) -#define ACHANNEL_HEIGHT_HALF (0.4f * U.widget_unit) -#define ACHANNEL_SKIP (0.1f * U.widget_unit) -#define ACHANNEL_STEP (ACHANNEL_HEIGHT + ACHANNEL_SKIP) +#define ACHANNEL_FIRST(ac) (-0.8f * (ac)->yscale_fac * U.widget_unit) +#define ACHANNEL_HEIGHT(ac) (0.8f * (ac)->yscale_fac * U.widget_unit) +#define ACHANNEL_HEIGHT_HALF(ac) (0.4f * (ac)->yscale_fac * U.widget_unit) +#define ACHANNEL_SKIP (0.1f * U.widget_unit) +#define ACHANNEL_STEP(ac) (ACHANNEL_HEIGHT(ac) + ACHANNEL_SKIP) /* channel widths */ #define ACHANNEL_NAMEWIDTH (10 * U.widget_unit) @@ -347,7 +350,6 @@ typedef enum eAnimFilter_Flags { /* -------------- NLA Channel Defines -------------- */ /* NLA channel heights */ -// XXX: NLACHANNEL_FIRST isn't used? #define NLACHANNEL_FIRST (-0.8f * U.widget_unit) #define NLACHANNEL_HEIGHT(snla) ((snla && (snla->flag & SNLA_NOSTRIPCURVES)) ? (0.8f * U.widget_unit) : (1.2f * U.widget_unit)) #define NLACHANNEL_HEIGHT_HALF(snla) ((snla && (snla->flag & SNLA_NOSTRIPCURVES)) ? (0.4f * U.widget_unit) : (0.6f * U.widget_unit)) |