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-15 15:48:20 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-09-15 15:48:20 +0400
commit232571c61a0120e71d980e47351d0656475dcbb5 (patch)
tree1980460d86e5743306ce676f28c5feb399248469 /source/blender/editors/space_image
parent219b748dfc556d9920434fc67a9d0e980e8e7fab (diff)
code cleanup: replace macro for BLI_rect size/center with inline functions.
Diffstat (limited to 'source/blender/editors/space_image')
-rw-r--r--source/blender/editors/space_image/image_buttons.c6
-rw-r--r--source/blender/editors/space_image/image_draw.c2
-rw-r--r--source/blender/editors/space_image/image_edit.c8
-rw-r--r--source/blender/editors/space_image/image_ops.c8
-rw-r--r--source/blender/editors/space_image/space_image.c4
5 files changed, 14 insertions, 14 deletions
diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c
index c372973b7b0..3728d68fdbc 100644
--- a/source/blender/editors/space_image/image_buttons.c
+++ b/source/blender/editors/space_image/image_buttons.c
@@ -228,13 +228,13 @@ static void preview_cb(ScrArea *sa, struct uiBlock *block)
int mval[2];
if (G.scene->r.mode & R_BORDER) {
- winx *= BLI_RCT_SIZE_X(&G.scene->r.border);
- winy *= BLI_RCT_SIZE_Y(&G.scene->r.border);
+ winx *= BLI_rcti_size_x(&G.scene->r.border);
+ winy *= BLI_rctf_size_y(&G.scene->r.border);
}
/* while dragging we need to update the rects, otherwise it doesn't end with correct one */
- BLI_rctf_init(&dispf, 15.0f, BLI_RCT_SIZE_X(&block->rect) - 15.0f, 15.0f, (BLI_RCT_SIZE_Y(&block->rect)) - 15.0f);
+ BLI_rctf_init(&dispf, 15.0f, BLI_rcti_size_x(&block->rect) - 15.0f, 15.0f, (BLI_rctf_size_y(&block->rect)) - 15.0f);
ui_graphics_to_window_rct(sa->win, &dispf, disprect);
/* correction for gla draw */
diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c
index 638a2ac6681..52bb44d4e19 100644
--- a/source/blender/editors/space_image/image_draw.c
+++ b/source/blender/editors/space_image/image_draw.c
@@ -118,7 +118,7 @@ void ED_image_draw_info(Scene *scene, ARegion *ar, int color_manage, int use_def
/* noisy, high contrast make impossible to read if lower alpha is used. */
glColor4ub(0, 0, 0, 190);
- glRecti(0.0, 0.0, BLI_RCT_SIZE_X(&ar->winrct) + 1, 20);
+ glRecti(0.0, 0.0, BLI_rcti_size_x(&ar->winrct) + 1, 20);
glDisable(GL_BLEND);
BLF_size(blf_mono_font, 11, 72);
diff --git a/source/blender/editors/space_image/image_edit.c b/source/blender/editors/space_image/image_edit.c
index 79d01491df7..92433449985 100644
--- a/source/blender/editors/space_image/image_edit.c
+++ b/source/blender/editors/space_image/image_edit.c
@@ -161,8 +161,8 @@ void ED_space_image_get_size(SpaceImage *sima, int *width, int *height)
*height = (scene->r.ysch * scene->r.size) / 100;
if ((scene->r.mode & R_BORDER) && (scene->r.mode & R_CROP)) {
- *width *= BLI_RCT_SIZE_X(&scene->r.border);
- *height *= BLI_RCT_SIZE_Y(&scene->r.border);
+ *width *= BLI_rctf_size_x(&scene->r.border);
+ *height *= BLI_rctf_size_y(&scene->r.border);
}
}
@@ -204,8 +204,8 @@ void ED_space_image_get_zoom(SpaceImage *sima, ARegion *ar, float *zoomx, float
ED_space_image_get_size(sima, &width, &height);
- *zoomx = (float)(BLI_RCT_SIZE_X(&ar->winrct) + 1) / (float)(BLI_RCT_SIZE_X(&ar->v2d.cur) * width);
- *zoomy = (float)(BLI_RCT_SIZE_Y(&ar->winrct) + 1) / (float)(BLI_RCT_SIZE_Y(&ar->v2d.cur) * height);
+ *zoomx = (float)(BLI_rcti_size_x(&ar->winrct) + 1) / (float)(BLI_rctf_size_x(&ar->v2d.cur) * width);
+ *zoomy = (float)(BLI_rcti_size_y(&ar->winrct) + 1) / (float)(BLI_rctf_size_y(&ar->v2d.cur) * height);
}
void ED_space_image_get_uv_aspect(SpaceImage *sima, float *aspx, float *aspy)
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c
index 16804c5a1c6..096ae0d756a 100644
--- a/source/blender/editors/space_image/image_ops.c
+++ b/source/blender/editors/space_image/image_ops.c
@@ -99,9 +99,9 @@ static void sima_zoom_set(SpaceImage *sima, ARegion *ar, float zoom, float locat
if ((width < 4) && (height < 4))
sima->zoom = oldzoom;
- else if (BLI_RCT_SIZE_X(&ar->winrct) <= sima->zoom)
+ else if (BLI_rcti_size_x(&ar->winrct) <= sima->zoom)
sima->zoom = oldzoom;
- else if (BLI_RCT_SIZE_Y(&ar->winrct) <= sima->zoom)
+ else if (BLI_rcti_size_y(&ar->winrct) <= sima->zoom)
sima->zoom = oldzoom;
}
@@ -582,8 +582,8 @@ static int image_view_all_exec(bContext *C, wmOperator *UNUSED(op))
h = height * aspy;
/* check if the image will fit in the image with (zoom == 1) */
- width = BLI_RCT_SIZE_X(&ar->winrct) + 1;
- height = BLI_RCT_SIZE_Y(&ar->winrct) + 1;
+ width = BLI_rcti_size_x(&ar->winrct) + 1;
+ height = BLI_rcti_size_y(&ar->winrct) + 1;
if ((w >= width || h >= height) && (width > 0 && height > 0)) {
/* find the zoom value that will fit the image in the image space */
diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c
index 5b288bd6149..4d4129b3420 100644
--- a/source/blender/editors/space_image/space_image.c
+++ b/source/blender/editors/space_image/space_image.c
@@ -558,8 +558,8 @@ static void image_main_area_set_view2d(SpaceImage *sima, ARegion *ar)
if (ima)
h *= ima->aspy / ima->aspx;
- winx = BLI_RCT_SIZE_X(&ar->winrct) + 1;
- winy = BLI_RCT_SIZE_Y(&ar->winrct) + 1;
+ winx = BLI_rcti_size_x(&ar->winrct) + 1;
+ winy = BLI_rcti_size_y(&ar->winrct) + 1;
ar->v2d.tot.xmin = 0;
ar->v2d.tot.ymin = 0;