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:
authorCampbell Barton <ideasman42@gmail.com>2012-09-13 06:28:48 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-09-13 06:28:48 +0400
commitc5310521f8d9099fc36431bae76dd0a402cc077e (patch)
treed60e9f1807d8790355109fdf7975db4df45c7383 /source/blender
parentab48f2108bc8ff1dfcc34e2f395debac97be7826 (diff)
fix for drawing non 1:1 aspect masks, transform and selection still need support.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/include/ED_mask.h3
-rw-r--r--source/blender/editors/mask/mask_draw.c6
-rw-r--r--source/blender/editors/space_clip/space_clip.c3
-rw-r--r--source/blender/editors/space_image/space_image.c3
-rw-r--r--source/blender/editors/space_sequencer/sequencer_draw.c2
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);
}