Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Eisel <eiseljulian@gmail.com>2020-01-16 17:55:49 +0300
committerJulian Eisel <eiseljulian@gmail.com>2020-01-16 18:13:15 +0300
commitd52551401e185a3e1092fb07edebd07d552e04e2 (patch)
tree0b109024b0acaedc9707f2d8034e8da82bf0d146 /source/blender/windowmanager/intern/wm_draw.c
parent5b8c2301d8b7400013903fe0b02071ba19aafb9f (diff)
Fix wrong usages of region align enumerations
`ARegion.alignment` unfortunately is a mixture of value and bitflag enumerations. When checking for left/right/top/bottom region alignment, the flags have to be masked out usually. Most of the fixed cases here probably didn't cause issues in practice, but could in fact break at any point when surrounding logic changes. In fact the assert in #region_visible_rect_calc() failed in an older file from https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=949035. This fixes it.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_draw.c')
-rw-r--r--source/blender/windowmanager/intern/wm_draw.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c
index 14d4e05b77a..a26a728461d 100644
--- a/source/blender/windowmanager/intern/wm_draw.c
+++ b/source/blender/windowmanager/intern/wm_draw.c
@@ -514,12 +514,12 @@ void wm_draw_region_blend(ARegion *ar, int view, bool blend)
/* Slide vertical panels */
float ofs_x = BLI_rcti_size_x(&ar->winrct) * (1.0f - alpha_easing);
- if (ar->alignment == RGN_ALIGN_RIGHT) {
+ if (RGN_ALIGN_ENUM_FROM_MASK(ar->alignment) == RGN_ALIGN_RIGHT) {
rect_geo.xmin += ofs_x;
rect_tex.xmax *= alpha_easing;
alpha = 1.0f;
}
- else if (ar->alignment == RGN_ALIGN_LEFT) {
+ else if (RGN_ALIGN_ENUM_FROM_MASK(ar->alignment) == RGN_ALIGN_LEFT) {
rect_geo.xmax -= ofs_x;
rect_tex.xmin += 1.0f - alpha_easing;
alpha = 1.0f;