[Bf-blender-cvs] [a86bb2594f1] blender-v2.92-release: Fix T84698: error adding movie clip tracks

Campbell Barton noreply at git.blender.org
Tue Jan 19 10:43:16 CET 2021


Commit: a86bb2594f1e417041a849c42252125d0ff1b491
Author: Campbell Barton
Date:   Tue Jan 19 20:29:05 2021 +1100
Branches: blender-v2.92-release
https://developer.blender.org/rBa86bb2594f1e417041a849c42252125d0ff1b491

Fix T84698: error adding movie clip tracks

The movie clip's `region->v2d` was being resized by the view2d code,
causing mouse cursor to movie-clip coordinate mapping to fail.

This commit removes `UI_view2d_region_reinit`,
matching the behavior for the image editor's 2D view.

Reviewed By: sergey

Ref D10106

===================================================================

M	source/blender/editors/space_clip/space_clip.c
M	source/blender/editors/space_image/space_image.c

===================================================================

diff --git a/source/blender/editors/space_clip/space_clip.c b/source/blender/editors/space_clip/space_clip.c
index b17a0ba03d5..3bdf016b64c 100644
--- a/source/blender/editors/space_clip/space_clip.c
+++ b/source/blender/editors/space_clip/space_clip.c
@@ -880,7 +880,8 @@ static void clip_main_region_init(wmWindowManager *wm, ARegion *region)
 {
   wmKeyMap *keymap;
 
-  UI_view2d_region_reinit(&region->v2d, V2D_COMMONVIEW_STANDARD, region->winx, region->winy);
+  /* NOTE: don't use `UI_view2d_region_reinit(&region->v2d, ...)`
+   * since the space clip manages own v2d in #movieclip_main_area_set_view2d */
 
   /* mask polls mode */
   keymap = WM_keymap_ensure(wm->defaultconf, "Mask Editing", 0, 0);
diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c
index 1981f04682d..d504bfbe276 100644
--- a/source/blender/editors/space_image/space_image.c
+++ b/source/blender/editors/space_image/space_image.c
@@ -603,8 +603,8 @@ static void image_main_region_init(wmWindowManager *wm, ARegion *region)
 {
   wmKeyMap *keymap;
 
-  /* Image space manages own v2d. */
-  // UI_view2d_region_reinit(&region->v2d, V2D_COMMONVIEW_STANDARD, region->winx, region->winy);
+  /* NOTE: don't use `UI_view2d_region_reinit(&region->v2d, ...)`
+   * since the space clip manages own v2d in #image_main_region_set_view2d */
 
   /* mask polls mode */
   keymap = WM_keymap_ensure(wm->defaultconf, "Mask Editing", 0, 0);



More information about the Bf-blender-cvs mailing list