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:
authorDalai Felinto <dfelinto@gmail.com>2019-07-10 02:07:08 +0300
committerDalai Felinto <dfelinto@gmail.com>2019-07-10 15:04:24 +0300
commitfde88ad9d2fc93caa6c3cc39d4c009a0c9bac7c5 (patch)
treeb8552569579717722a762b3fc0e8e3a6b32330a4 /source/blender
parent91b42627287e47abe3845b56edb5532f32dcdb31 (diff)
Fix T66627: Multiobject Edit UV constraint to image bounds
This was broken since the original commit to handle multi-object editing: rBbfc9d426bb95.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/transform/transform_conversions.c76
1 files changed, 37 insertions, 39 deletions
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index 1b5ac66644d..27a2ab85127 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -3710,50 +3710,48 @@ bool clipUVTransform(TransInfo *t, float vec[2], const bool resize)
for (a = 0, td = tc->data; a < tc->data_len; a++, td++) {
minmax_v2v2_v2(min, max, td->loc);
}
+ }
- if (resize) {
- if (min[0] < 0.0f && t->center_global[0] > 0.0f &&
- t->center_global[0] < t->aspect[0] * 0.5f) {
- vec[0] *= t->center_global[0] / (t->center_global[0] - min[0]);
- }
- else if (max[0] > t->aspect[0] && t->center_global[0] < t->aspect[0]) {
- vec[0] *= (t->center_global[0] - t->aspect[0]) / (t->center_global[0] - max[0]);
- }
- else {
- clipx = 0;
- }
+ if (resize) {
+ if (min[0] < 0.0f && t->center_global[0] > 0.0f && t->center_global[0] < t->aspect[0] * 0.5f) {
+ vec[0] *= t->center_global[0] / (t->center_global[0] - min[0]);
+ }
+ else if (max[0] > t->aspect[0] && t->center_global[0] < t->aspect[0]) {
+ vec[0] *= (t->center_global[0] - t->aspect[0]) / (t->center_global[0] - max[0]);
+ }
+ else {
+ clipx = 0;
+ }
- if (min[1] < 0.0f && t->center_global[1] > 0.0f &&
- t->center_global[1] < t->aspect[1] * 0.5f) {
- vec[1] *= t->center_global[1] / (t->center_global[1] - min[1]);
- }
- else if (max[1] > t->aspect[1] && t->center_global[1] < t->aspect[1]) {
- vec[1] *= (t->center_global[1] - t->aspect[1]) / (t->center_global[1] - max[1]);
- }
- else {
- clipy = 0;
- }
+ if (min[1] < 0.0f && t->center_global[1] > 0.0f && t->center_global[1] < t->aspect[1] * 0.5f) {
+ vec[1] *= t->center_global[1] / (t->center_global[1] - min[1]);
+ }
+ else if (max[1] > t->aspect[1] && t->center_global[1] < t->aspect[1]) {
+ vec[1] *= (t->center_global[1] - t->aspect[1]) / (t->center_global[1] - max[1]);
}
else {
- if (min[0] < 0.0f) {
- vec[0] -= min[0];
- }
- else if (max[0] > t->aspect[0]) {
- vec[0] -= max[0] - t->aspect[0];
- }
- else {
- clipx = 0;
- }
+ clipy = 0;
+ }
+ }
+ else {
+ if (min[0] < 0.0f) {
+ vec[0] -= min[0];
+ }
+ else if (max[0] > t->aspect[0]) {
+ vec[0] -= max[0] - t->aspect[0];
+ }
+ else {
+ clipx = 0;
+ }
- if (min[1] < 0.0f) {
- vec[1] -= min[1];
- }
- else if (max[1] > t->aspect[1]) {
- vec[1] -= max[1] - t->aspect[1];
- }
- else {
- clipy = 0;
- }
+ if (min[1] < 0.0f) {
+ vec[1] -= min[1];
+ }
+ else if (max[1] > t->aspect[1]) {
+ vec[1] -= max[1] - t->aspect[1];
+ }
+ else {
+ clipy = 0;
}
}