diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-02-08 13:05:45 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-02-08 13:05:45 +0400 |
commit | c6865e823c4b8f5fc1b5ebe0e7e40227f5eb890c (patch) | |
tree | a8cd8112d43eab58e8d841e6041a10b1d08ef88d /source | |
parent | bc5df753aaaf116520d15df0aa53a054e6b1606a (diff) |
Fix #34165: Disappearing active marker label in timeline window
Simply clamp label position from bottom.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/animation/anim_markers.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c index ccd8309f794..62725cb6c70 100644 --- a/source/blender/editors/animation/anim_markers.c +++ b/source/blender/editors/animation/anim_markers.c @@ -41,6 +41,7 @@ #include "RNA_enum_types.h" #include "BLI_blenlib.h" +#include "BLI_math_base.h" #include "BLI_utildefines.h" #include "BKE_context.h" @@ -401,17 +402,22 @@ static void draw_marker(View2D *v2d, TimeMarker *marker, int cfra, int flag) /* and the marker name too, shifted slightly to the top-right */ if (marker->name && marker->name[0]) { float x, y; + + /* minimal y coordinate which wouldn't be occluded by scroll */ + int min_y = 17.0f * UI_DPI_FAC; if (marker->flag & SELECT) { UI_ThemeColor(TH_TEXT_HI); x = xpos * xscale + 4.0f * UI_DPI_FAC; y = (ypixels <= 39.0f * UI_DPI_FAC) ? (ypixels - 10.0f * UI_DPI_FAC) : 29.0f * UI_DPI_FAC; + y = max_ii(y, min_y); } else { UI_ThemeColor(TH_TEXT); if ((marker->frame <= cfra) && (marker->frame + 5 > cfra)) { x = xpos * xscale + 8.0f * UI_DPI_FAC; y = (ypixels <= 39.0f * UI_DPI_FAC) ? (ypixels - 10.0f * UI_DPI_FAC) : 29.0f * UI_DPI_FAC; + y = max_ii(y, min_y); } else { x = xpos * xscale + 8.0f * UI_DPI_FAC; |