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-06 14:18:05 +0300
committerTianwei Shen <shentianweipku@gmail.com>2016-08-06 14:18:05 +0300
commit174cbc6aba4c2a52d547f4e0d82240428dbf4169 (patch)
tree70505d8ecbf1a289d703e7980291371ed73ddf80 /source/blender/editors/space_clip
parentab73d3ab27747271af9d7f500c3054334f9cfd00 (diff)
remove duplicate code by adding a movieclip select
Diffstat (limited to 'source/blender/editors/space_clip')
-rw-r--r--source/blender/editors/space_clip/clip_editor.c11
-rw-r--r--source/blender/editors/space_clip/space_clip.c8
2 files changed, 12 insertions, 7 deletions
diff --git a/source/blender/editors/space_clip/clip_editor.c b/source/blender/editors/space_clip/clip_editor.c
index b8aa1264632..07cd0eba978 100644
--- a/source/blender/editors/space_clip/clip_editor.c
+++ b/source/blender/editors/space_clip/clip_editor.c
@@ -617,6 +617,17 @@ MovieClip *ED_space_clip_get_secondary_clip(SpaceClip *sc)
return sc->secondary_clip;
}
+MovieClip *ED_space_clip_get_clip_in_region(SpaceClip *sc, ARegion *ar)
+{
+ RegionSpaceClip *rsc = ar->regiondata;
+ if (rsc->flag == RSC_MAIN_CLIP) {
+ return ED_space_clip_get_clip(sc);
+ }
+ else { //rsc->flag == RSC_SECONDARY_CLIP
+ return ED_space_clip_get_secondary_clip(sc);
+ }
+}
+
void ED_space_clip_set_clip(bContext *C, bScreen *screen, SpaceClip *sc, MovieClip *clip)
{
MovieClip *old_clip;
diff --git a/source/blender/editors/space_clip/space_clip.c b/source/blender/editors/space_clip/space_clip.c
index e3525dfee88..87999c5bc2d 100644
--- a/source/blender/editors/space_clip/space_clip.c
+++ b/source/blender/editors/space_clip/space_clip.c
@@ -1174,13 +1174,7 @@ static void clip_main_region_draw(const bContext *C, ARegion *ar)
/* draw entirely, view changes should be handled here */
SpaceClip *sc = CTX_wm_space_clip(C);
RegionSpaceClip *rsc = CTX_wm_region_clip(C);
- MovieClip *clip;
- if (rsc->flag == RSC_MAIN_CLIP) {
- clip = ED_space_clip_get_clip(sc);
- }
- else {
- clip = ED_space_clip_get_secondary_clip(sc);
- }
+ MovieClip *clip = ED_space_clip_get_clip_in_region(sc, ar);
float aspx, aspy, zoomx, zoomy, x, y;
int width, height;
bool show_cursor = false;