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:
authorTianwei Shen <shentianweipku@gmail.com>2016-08-04 11:41:29 +0300
committerTianwei Shen <shentianweipku@gmail.com>2016-08-04 11:42:40 +0300
commitcdc29928b211acde9699b04c3a30943c9fe4025d (patch)
treecdfba67bc03780917062e4dcacabd4e40efa8033 /source/blender/editors/space_clip
parent8ec606af045ca6d3cabb93f137a3b33c82409db2 (diff)
add a flag field to RegionSpaceClip
- this field is to specify main clip or secondary clip, used in drawing code
Diffstat (limited to 'source/blender/editors/space_clip')
-rw-r--r--source/blender/editors/space_clip/clip_editor.c6
-rw-r--r--source/blender/editors/space_clip/space_clip.c7
2 files changed, 12 insertions, 1 deletions
diff --git a/source/blender/editors/space_clip/clip_editor.c b/source/blender/editors/space_clip/clip_editor.c
index 580b6f65da9..f5b65d41286 100644
--- a/source/blender/editors/space_clip/clip_editor.c
+++ b/source/blender/editors/space_clip/clip_editor.c
@@ -758,8 +758,14 @@ void ED_clip_update_correspondence_mode(bContext *C, SpaceClip *sc)
ScrArea *sa = CTX_wm_area(C);
ar->alignment = RGN_ALIGN_VSPLIT;
+ RegionSpaceClip *rsc = ar->regiondata;
+ rsc->flag = RSC_MAIN_CLIP;
+ /* set the region type to RSC_SECONDARY_CLIP so that
+ * clip_main_region_draw is aware of this */
ARegion *newar = BKE_area_region_copy(sa->type, ar);
+ RegionSpaceClip *new_rsc = newar->regiondata;
+ new_rsc->flag = RSC_SECONDARY_CLIP;
BLI_addtail(&sa->regionbase, newar);
/* update split view */
diff --git a/source/blender/editors/space_clip/space_clip.c b/source/blender/editors/space_clip/space_clip.c
index fa2a36d0f6a..27925faa3ed 100644
--- a/source/blender/editors/space_clip/space_clip.c
+++ b/source/blender/editors/space_clip/space_clip.c
@@ -306,6 +306,7 @@ static SpaceLink *clip_new(const bContext *C)
/* region data for main region */
RegionSpaceClip *rsc = MEM_callocN(sizeof(RegionSpaceClip), "region data for clip");
rsc->zoom = 1.0f;
+ rsc->flag = RSC_MAIN_CLIP;
ar->regiondata = rsc;
return (SpaceLink *) sc;
@@ -1254,7 +1255,11 @@ static void clip_main_region_draw(const bContext *C, ARegion *ar)
/* data... */
movieclip_main_area_set_view2d(C, ar);
- clip_draw_main(C, sc, ar);
+ if (rsc->flag == RSC_MAIN_CLIP)
+ clip_draw_main(C, sc, ar);
+ else { // rsc->flag = RSC_SECONDARY_CLIP
+ clip_draw_secondary_clip(C, sc, ar);
+ }
/* TODO(sergey): would be nice to find a way to de-duplicate all this space conversions */
UI_view2d_view_to_region_fl(&ar->v2d, 0.0f, 0.0f, &x, &y);