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>2008-05-10 00:08:28 +0400
committerCampbell Barton <ideasman42@gmail.com>2008-05-10 00:08:28 +0400
commit76c13cc0f7d40db88ba08581129cf6fa4376df10 (patch)
tree8ad945dd63b16c92aff39256d56b0ec234041ca5 /source/blender/blenlib
parenta7a9c74ccb3c1f2dce29bb92c64c837c86ad7e80 (diff)
fix for [#8359] Sequencer image preview: HOME hotkey zooming at output res, not at "full view"
also made image and sequencer account for aspect ratio and added numpad 1,2,4,8 keys for zooming.
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r--source/blender/blenlib/BLI_arithb.h2
-rw-r--r--source/blender/blenlib/intern/arithb.c5
2 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/blenlib/BLI_arithb.h b/source/blender/blenlib/BLI_arithb.h
index 5b4e380f88e..9ed23bc32b6 100644
--- a/source/blender/blenlib/BLI_arithb.h
+++ b/source/blender/blenlib/BLI_arithb.h
@@ -96,7 +96,7 @@ float CalcNormFloat4(float *v1, float *v2, float *v3, float *v4, float *n);
void CalcNormLong(int *v1, int *v2, int *v3, float *n);
/* CalcNormShort: is ook uitprodukt - (translates as 'is also out/cross product') */
void CalcNormShort(short *v1, short *v2, short *v3, float *n);
-
+float power_of_2(float val);
/**
* @section Euler conversion routines
diff --git a/source/blender/blenlib/intern/arithb.c b/source/blender/blenlib/intern/arithb.c
index 19a8d4f5152..48a149f4b3a 100644
--- a/source/blender/blenlib/intern/arithb.c
+++ b/source/blender/blenlib/intern/arithb.c
@@ -4345,3 +4345,8 @@ void tangent_from_uv(float *uv1, float *uv2, float *uv3, float *co1, float *co2,
if ((ct[0]*n[0] + ct[1]*n[1] + ct[2]*n[2]) < 0.0f)
VecMulf(tang, -1.0f);
}
+
+/* used for zoom values*/
+float power_of_2(float val) {
+ return pow(2, ceil(log(val) / log(2)));
+}