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>2021-07-05 14:41:02 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-07-05 15:02:57 +0300
commit416e006a2aee09a6354fad9aec6a3f44f9f758b8 (patch)
tree6e8bd578513034d0d1543f37279af7fe0965765e /source/blender/editors/space_image
parent92b775d31930ba1a625336a8145996ec437d4c87 (diff)
Cleanup: use 'use_' prefix for RNA booleans
Diffstat (limited to 'source/blender/editors/space_image')
-rw-r--r--source/blender/editors/space_image/image_ops.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c
index 193c35d10a2..b4e1f1ec9fc 100644
--- a/source/blender/editors/space_image/image_ops.c
+++ b/source/blender/editors/space_image/image_ops.c
@@ -2712,10 +2712,10 @@ static int image_flip_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
- const bool flip_horizontal = RNA_boolean_get(op->ptr, "use_flip_horizontal");
- const bool flip_vertical = RNA_boolean_get(op->ptr, "use_flip_vertical");
+ const bool use_flip_x = RNA_boolean_get(op->ptr, "use_flip_x");
+ const bool use_flip_y = RNA_boolean_get(op->ptr, "use_flip_y");
- if (!flip_horizontal && !flip_vertical) {
+ if (!use_flip_x && !use_flip_y) {
BKE_image_release_ibuf(ima, ibuf, NULL);
return OPERATOR_FINISHED;
}
@@ -2735,8 +2735,8 @@ static int image_flip_exec(bContext *C, wmOperator *op)
float *orig_float_pixels = MEM_dupallocN(float_pixels);
for (int x = 0; x < size_x; x++) {
for (int y = 0; y < size_y; y++) {
- const int source_pixel_x = flip_horizontal ? size_x - x - 1 : x;
- const int source_pixel_y = flip_vertical ? size_y - y - 1 : y;
+ const int source_pixel_x = use_flip_x ? size_x - x - 1 : x;
+ const int source_pixel_y = use_flip_y ? size_y - y - 1 : y;
float *source_pixel = &orig_float_pixels[4 * (source_pixel_x + source_pixel_y * size_x)];
float *target_pixel = &float_pixels[4 * (x + y * size_x)];
@@ -2755,8 +2755,8 @@ static int image_flip_exec(bContext *C, wmOperator *op)
char *orig_char_pixels = MEM_dupallocN(char_pixels);
for (int x = 0; x < size_x; x++) {
for (int y = 0; y < size_y; y++) {
- const int source_pixel_x = flip_horizontal ? size_x - x - 1 : x;
- const int source_pixel_y = flip_vertical ? size_y - y - 1 : y;
+ const int source_pixel_x = use_flip_x ? size_x - x - 1 : x;
+ const int source_pixel_y = use_flip_y ? size_y - y - 1 : y;
char *source_pixel = &orig_char_pixels[4 * (source_pixel_x + source_pixel_y * size_x)];
char *target_pixel = &char_pixels[4 * (x + y * size_x)];
@@ -2804,10 +2804,9 @@ void IMAGE_OT_flip(wmOperatorType *ot)
/* properties */
PropertyRNA *prop;
prop = RNA_def_boolean(
- ot->srna, "use_flip_horizontal", false, "Horizontal", "Flip the image horizontally");
+ ot->srna, "use_flip_x", false, "Horizontal", "Flip the image horizontally");
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
- prop = RNA_def_boolean(
- ot->srna, "use_flip_vertical", false, "Vertical", "Flip the image vertically");
+ prop = RNA_def_boolean(ot->srna, "use_flip_y", false, "Vertical", "Flip the image vertically");
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
/* flags */