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:
authorRichard Antalik <richardantalik@gmail.com>2021-11-29 14:19:12 +0300
committerRichard Antalik <richardantalik@gmail.com>2021-11-29 14:44:42 +0300
commit7c703b4699e1e89686e0ba5fa4f7af7e41968b68 (patch)
treedfa6041ee82cb7600b428593dd84af6d5d8bee7d /source/blender/sequencer/intern
parentf1118ee51ea02c3c4ca6f088e81dc6dbba1ba7fe (diff)
Fix T93417: Strip outline not aligned with image
When using non-uniform aspect ratio, strip outline is not aligned correctly. Apply pixel aspect ratio to image quad and origin.
Diffstat (limited to 'source/blender/sequencer/intern')
-rw-r--r--source/blender/sequencer/intern/strip_transform.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/sequencer/intern/strip_transform.c b/source/blender/sequencer/intern/strip_transform.c
index 63ab4a30edc..aaa1688527e 100644
--- a/source/blender/sequencer/intern/strip_transform.c
+++ b/source/blender/sequencer/intern/strip_transform.c
@@ -463,9 +463,11 @@ void SEQ_image_transform_origin_offset_pixelspace_get(const Scene *scene,
r_origin[0] = (image_size[0] * transform->origin[0]) - (image_size[0] * 0.5f) + transform->xofs;
r_origin[1] = (image_size[1] * transform->origin[1]) - (image_size[1] * 0.5f) + transform->yofs;
+ const float viewport_pixel_aspect[2] = {scene->r.xasp / scene->r.yasp, 1.0f};
float mirror[2];
SEQ_image_transform_mirror_factor_get(seq, mirror);
mul_v2_v2(r_origin, mirror);
+ mul_v2_v2(r_origin, viewport_pixel_aspect);
}
static void seq_image_transform_quad_get_ex(const Scene *scene,
@@ -483,7 +485,6 @@ static void seq_image_transform_quad_get_ex(const Scene *scene,
}
float transform_matrix[4][4];
-
float rotation_matrix[3][3];
axis_angle_to_mat3_single(rotation_matrix, 'Z', apply_rotation ? transform->rotation : 0.0f);
loc_rot_size_to_mat4(transform_matrix,
@@ -512,9 +513,12 @@ static void seq_image_transform_quad_get_ex(const Scene *scene,
float mirror[2];
SEQ_image_transform_mirror_factor_get(seq, mirror);
+ const float viewport_pixel_aspect[2] = {scene->r.xasp / scene->r.yasp, 1.0f};
+
for (int i = 0; i < 4; i++) {
mul_m4_v3(transform_matrix, quad_temp[i]);
mul_v2_v2(quad_temp[i], mirror);
+ mul_v2_v2(quad_temp[i], viewport_pixel_aspect);
copy_v2_v2(r_quad[i], quad_temp[i]);
}
}