diff options
-rw-r--r-- | source/blender/editors/include/ED_mask.h | 3 | ||||
-rw-r--r-- | source/blender/editors/mask/mask_draw.c | 6 | ||||
-rw-r--r-- | source/blender/editors/space_clip/space_clip.c | 3 | ||||
-rw-r--r-- | source/blender/editors/space_image/space_image.c | 3 | ||||
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_draw.c | 2 |
5 files changed, 15 insertions, 2 deletions
diff --git a/source/blender/editors/include/ED_mask.h b/source/blender/editors/include/ED_mask.h index 88667729eee..8ebf932fd96 100644 --- a/source/blender/editors/include/ED_mask.h +++ b/source/blender/editors/include/ED_mask.h @@ -56,7 +56,8 @@ void ED_operatormacros_mask(void); void ED_mask_draw(const bContext *C, const char draw_flag, const char draw_type); void ED_mask_draw_region(struct Mask *mask, struct ARegion *ar, const char draw_flag, const char draw_type, - int width, int height, + const int width_i, const int height_i, + const float aspx, const float aspy, const short do_scale_applied, const short do_post_draw, float stabmat[4][4], const bContext *C); diff --git a/source/blender/editors/mask/mask_draw.c b/source/blender/editors/mask/mask_draw.c index 00bbfcf3188..655458bd4cb 100644 --- a/source/blender/editors/mask/mask_draw.c +++ b/source/blender/editors/mask/mask_draw.c @@ -496,7 +496,8 @@ void ED_mask_draw(const bContext *C, * width, height are to match the values from ED_mask_get_size() */ void ED_mask_draw_region(Mask *mask, ARegion *ar, const char draw_flag, const char draw_type, - int width, int height, + const int width_i, const int height_i, /* convert directly into aspect corrected vars */ + const float aspx, const float aspy, const short do_scale_applied, const short do_post_draw, float stabmat[4][4], /* optional - only used by clip */ const bContext *C /* optional - only used when do_post_draw is set */ @@ -504,6 +505,9 @@ void ED_mask_draw_region(Mask *mask, ARegion *ar, { struct View2D *v2d = &ar->v2d; + /* aspect always scales vertically in movie and image spaces */ + const float width = width_i, height = (float)height_i * (aspy / aspx); + int x, y; /* int w, h; */ float zoomx, zoomy; diff --git a/source/blender/editors/space_clip/space_clip.c b/source/blender/editors/space_clip/space_clip.c index bb06104d442..7f43c404095 100644 --- a/source/blender/editors/space_clip/space_clip.c +++ b/source/blender/editors/space_clip/space_clip.c @@ -1131,10 +1131,13 @@ static void clip_main_area_draw(const bContext *C, ARegion *ar) if (mask) { ScrArea *sa = CTX_wm_area(C); int width, height; + float aspx, aspy; ED_mask_get_size(sa, &width, &height); + ED_space_clip_get_aspect(sc, &aspx, &aspy); ED_mask_draw_region(mask, ar, sc->mask_info.draw_flag, sc->mask_info.draw_type, width, height, + aspx, aspy, TRUE, TRUE, sc->stabmat, C); } diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index 9cceaf0aa8e..91a0cba2555 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -682,10 +682,13 @@ static void image_main_area_draw(const bContext *C, ARegion *ar) if (mask) { int width, height; + float aspx, aspy; ED_space_image_get_size(sima, &width, &height); + ED_space_image_get_aspect(sima, &aspx, &aspy); ED_mask_draw_region(mask, ar, sima->mask_info.draw_flag, sima->mask_info.draw_type, width, height, + aspx, aspy, TRUE, FALSE, NULL, C); diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index ddb681236b6..0c316450c29 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -1049,6 +1049,7 @@ void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq if (mask) { int width, height; + float aspx = 1.0f, aspy = 1.0f; // ED_mask_get_size(C, &width, &height); //Scene *scene = CTX_data_scene(C); @@ -1058,6 +1059,7 @@ void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq ED_mask_draw_region(mask, ar, 0, 0, /* TODO */ width, height, + aspx, aspy, FALSE, TRUE, NULL, C); } |