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-07-26 15:47:47 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-07-26 15:47:47 +0400
commitf39a21c36f63f2dac4dc530f6ea3d98efc75fd9d (patch)
tree82a08421488ab985c5d9c08ff5ad0343ee55d598
parentfec872ef9c0bb6904cbe9a7b59b3f51ae7bb0702 (diff)
add ED_space_image_get_size_fl, ED_space_clip_get_size_fl
-rw-r--r--source/blender/editors/include/ED_clip.h1
-rw-r--r--source/blender/editors/include/ED_image.h1
-rw-r--r--source/blender/editors/mask/mask_edit.c15
-rw-r--r--source/blender/editors/space_clip/clip_editor.c8
-rw-r--r--source/blender/editors/space_image/image_edit.c8
-rw-r--r--source/blender/editors/transform/transform_generics.c5
-rw-r--r--source/blender/editors/uvedit/uvedit_ops.c4
7 files changed, 24 insertions, 18 deletions
diff --git a/source/blender/editors/include/ED_clip.h b/source/blender/editors/include/ED_clip.h
index 8949eb8442d..f1b405c2c3e 100644
--- a/source/blender/editors/include/ED_clip.h
+++ b/source/blender/editors/include/ED_clip.h
@@ -53,6 +53,7 @@ int ED_space_clip_maskedit_poll(struct bContext *C);
int ED_space_clip_maskedit_mask_poll(bContext *C);
void ED_space_clip_get_size(const struct bContext *C, int *width, int *height);
+void ED_space_clip_get_size_fl(const struct bContext *C, float size[2]);
void ED_space_clip_get_zoom(const struct bContext *C, float *zoomx, float *zoomy);
void ED_space_clip_get_aspect(struct SpaceClip *sc, float *aspx, float *aspy);
void ED_space_clip_get_aspect_dimension_aware(struct SpaceClip *sc, float *aspx, float *aspy);
diff --git a/source/blender/editors/include/ED_image.h b/source/blender/editors/include/ED_image.h
index 6edbe33de32..830a6104770 100644
--- a/source/blender/editors/include/ED_image.h
+++ b/source/blender/editors/include/ED_image.h
@@ -52,6 +52,7 @@ void ED_space_image_release_buffer(struct SpaceImage *sima, void *lock);
int ED_space_image_has_buffer(struct SpaceImage *sima);
void ED_space_image_get_size(struct SpaceImage *sima, int *width, int *height);
+void ED_space_image_get_size_fl(struct SpaceImage *sima, float size[2]);
void ED_space_image_get_aspect(struct SpaceImage *sima, float *aspx, float *aspy);
void ED_space_image_get_zoom(struct SpaceImage *sima, struct ARegion *ar, float *zoomx, float *zoomy);
void ED_space_image_get_uv_aspect(struct SpaceImage *sima, float *aspx, float *aspy);
diff --git a/source/blender/editors/mask/mask_edit.c b/source/blender/editors/mask/mask_edit.c
index 0491b164fec..5c724d9e5a3 100644
--- a/source/blender/editors/mask/mask_edit.c
+++ b/source/blender/editors/mask/mask_edit.c
@@ -110,13 +110,10 @@ void ED_mask_mouse_pos(const bContext *C, wmEvent *event, float co[2])
}
case SPACE_IMAGE:
{
- int width, height;
float frame_size[2];
SpaceImage *sima = sa->spacedata.first;
ARegion *ar = CTX_wm_region(C);
- ED_space_image_get_size(sima, &width, &height);
- frame_size[0] = width;
- frame_size[1] = height;
+ ED_space_image_get_size_fl(sima, frame_size);
ED_image_mouse_pos(sima, ar, event, co);
BKE_mask_coord_from_frame(co, co, frame_size);
break;
@@ -155,13 +152,10 @@ void ED_mask_point_pos(const bContext *C, float x, float y, float *xr, float *yr
break;
case SPACE_IMAGE:
{
- int width, height;
float frame_size[2];
SpaceImage *sima = sa->spacedata.first;
ARegion *ar = CTX_wm_region(C);
- ED_space_image_get_size(sima, &width, &height);
- frame_size[0] = width;
- frame_size[1] = height;
+ ED_space_image_get_size_fl(sima, frame_size);
ED_image_point_pos(sima, ar, x, y, &co[0], &co[1]);
BKE_mask_coord_from_frame(co, co, frame_size);
break;
@@ -203,13 +197,10 @@ void ED_mask_point_pos__reverse(const bContext *C, float x, float y, float *xr,
break;
case SPACE_IMAGE:
{
- int width, height;
float frame_size[2];
SpaceImage *sima = sa->spacedata.first;
ARegion *ar = CTX_wm_region(C);
- ED_space_image_get_size(sima, &width, &height);
- frame_size[0] = width;
- frame_size[1] = height;
+ ED_space_image_get_size_fl(sima, frame_size);
co[0] = x;
co[1] = y;
diff --git a/source/blender/editors/space_clip/clip_editor.c b/source/blender/editors/space_clip/clip_editor.c
index 52f5960c559..92fcbc2964d 100644
--- a/source/blender/editors/space_clip/clip_editor.c
+++ b/source/blender/editors/space_clip/clip_editor.c
@@ -136,6 +136,14 @@ void ED_space_clip_get_size(const bContext *C, int *width, int *height)
}
}
+void ED_space_clip_get_size_fl(const bContext *C, float size[2])
+{
+ int size_i[2];
+ ED_space_clip_get_size(C, &size_i[0], &size_i[1]);
+ size[0] = size_i[0];
+ size[1] = size_i[1];
+}
+
void ED_space_clip_get_zoom(const bContext *C, float *zoomx, float *zoomy)
{
ARegion *ar = CTX_wm_region(C);
diff --git a/source/blender/editors/space_image/image_edit.c b/source/blender/editors/space_image/image_edit.c
index 927f65f239b..65df6f98efb 100644
--- a/source/blender/editors/space_image/image_edit.c
+++ b/source/blender/editors/space_image/image_edit.c
@@ -192,6 +192,14 @@ void ED_space_image_get_size(SpaceImage *sima, int *width, int *height)
ED_space_image_release_buffer(sima, lock);
}
+void ED_space_image_get_size_fl(SpaceImage *sima, float size[2])
+{
+ int size_i[2];
+ ED_space_image_get_size(sima, &size_i[0], &size_i[1]);
+ size[0] = size_i[0];
+ size[1] = size_i[1];
+}
+
void ED_image_get_aspect(Image *ima, float *aspx, float *aspy)
{
*aspx = *aspy = 1.0;
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c
index 8962174ffe2..ff18b23dc91 100644
--- a/source/blender/editors/transform/transform_generics.c
+++ b/source/blender/editors/transform/transform_generics.c
@@ -1452,12 +1452,9 @@ void calculateCenterCursor2D(TransInfo *t)
if (cursor) {
if (t->options & CTX_MASK) {
float co[2];
- int width, height;
float frame_size[2];
SpaceImage *sima = (SpaceImage *)t->sa->spacedata.first;
- ED_space_image_get_size(sima, &width, &height);
- frame_size[0] = width;
- frame_size[1] = height;
+ ED_space_image_get_size_fl(sima, frame_size);
BKE_mask_coord_from_frame(co, cursor, frame_size);
diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c
index eea316920d3..0e129cb4dcb 100644
--- a/source/blender/editors/uvedit/uvedit_ops.c
+++ b/source/blender/editors/uvedit/uvedit_ops.c
@@ -295,8 +295,8 @@ static void uvedit_pixel_to_float(SpaceImage *sima, float *dist, float pixeldist
ED_space_image_get_size(sima, &width, &height);
}
else {
- width = 256;
- height = 256;
+ width = IMG_SIZE_FALLBACK;
+ height = IMG_SIZE_FALLBACK;
}
dist[0] = pixeldist / width;